diff --git a/docs/src/content/components/Text.md b/docs/src/content/components/Text.md index 8077a1008..f6f814aa6 100644 --- a/docs/src/content/components/Text.md +++ b/docs/src/content/components/Text.md @@ -34,3 +34,11 @@ Note you can change the rendering layer with the toggle at the top of the page. The text will smartly orientate based on the direction (clockwise / counter-clockwise) and location (top, bottom, left, right) of the arc :example{ component="Arc" name="label-direction" } + +:::note +Only supported in `Svg` layers. +::: + + diff --git a/docs/src/content/utils/cls.md b/docs/src/content/utils/cls.md index 77084a6d4..d11edff91 100644 --- a/docs/src/content/utils/cls.md +++ b/docs/src/content/utils/cls.md @@ -11,15 +11,26 @@ related: ] --- +## Usage + +### [clsx()](https://github.com/lukeed/clsx) + +```svelte live -## Usage +
+ {`class={cls('bg-error-500', true && 'bg-success-500')}`}
becomes
class="bg-success-500" +
+``` -### cls() +### [twMerge()](https://github.com/dcastil/tailwind-merge) + +```svelte live + -
clsx allows for conditional class additions
tailwind-merge dedups overlapping classes
-
- +
last class wins with tailwind-merge
+``` \ No newline at end of file diff --git a/docs/src/content/utils/format.md b/docs/src/content/utils/format.md index 622278c0d..e07677ef3 100644 --- a/docs/src/content/utils/format.md +++ b/docs/src/content/utils/format.md @@ -9,14 +9,26 @@ related: ] --- - - ## Usage ### format() -> Full API +:::note +[Full Layerstack API](https://www.layerstack.dev/docs/utils/format) +::: + +```svelte live + - +{format(1234.56, 'integer')}
+{format(1234.56, 'decimal')}
+{format(1234.56, 'currency')}
+{format(1234.56, 'currency', { currency: 'EUR' })}
+{format(0.5678, 'percent')}
+{format(0.5678, 'percentRound')}
+{format(1_234_567, 'metric')}
+{format(new Date(), 'day', { variant: 'short' })}
+{format(new Date(), 'custom', { custom: 'eee, MMMM do' })}
+``` diff --git a/docs/src/content/utils/pivot.md b/docs/src/content/utils/pivot.md index d55789cb4..84c3a42ff 100644 --- a/docs/src/content/utils/pivot.md +++ b/docs/src/content/utils/pivot.md @@ -5,16 +5,12 @@ layers: [] related: [] --- - - ## Usage ### pivotLonger (columns to rows) - +:example{name="pivot-longer" noResize } ### pivotWider (rows to columns) - +:example{name="pivot-wider" noResize } \ No newline at end of file diff --git a/docs/src/content/utils/string.md b/docs/src/content/utils/string.md index 9c9b1446d..0b0b335ca 100644 --- a/docs/src/content/utils/string.md +++ b/docs/src/content/utils/string.md @@ -12,23 +12,35 @@ related: ] --- - - ## Usage +:::note +See [LayerStack](https://www.layerstack.dev/docs/utils/string) for full API documentation. +::: + ### truncate() -> Full API +```svelte live + + +{truncate(str, 21)} +``` -{truncate("This is a really long string of text.", 21)} +:::note +Truncation is also built into the [Text](/docs/components/Text) component via the `truncate` prop. - +::: ### toTitleCase() -{toTitleCase("string of text")} +```svelte live + - +{toTitleCase('string of text')} +``` \ No newline at end of file diff --git a/docs/src/examples/utils/cls/cls.svelte b/docs/src/examples/utils/cls/cls.svelte deleted file mode 100644 index d73379367..000000000 --- a/docs/src/examples/utils/cls/cls.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/docs/src/examples/utils/format/format.svelte b/docs/src/examples/utils/format/format.svelte deleted file mode 100644 index 0ab885ae2..000000000 --- a/docs/src/examples/utils/format/format.svelte +++ /dev/null @@ -1,31 +0,0 @@ - - -{format(1234.56, 'integer')}
-{format(1234.56, 'decimal')}
-{format(1234.56, 'currency')}
-{format(0.5678, 'percent')}
-{format(0.5678, 'percentRound')}
-{format(1_234_567, 'metric')}
-{format(new Date(), 'day', { variant: 'short' })}
-{format(new Date(), 'custom', { custom: 'eee, MMMM do' })}
- diff --git a/docs/src/examples/utils/string/toTitleCase.svelte b/docs/src/examples/utils/string/toTitleCase.svelte deleted file mode 100644 index ede0708c5..000000000 --- a/docs/src/examples/utils/string/toTitleCase.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/docs/src/examples/utils/string/truncate.svelte b/docs/src/examples/utils/string/truncate.svelte deleted file mode 100644 index 357e4a9a5..000000000 --- a/docs/src/examples/utils/string/truncate.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - -