@skewedaspect/sleekspace-ui 0.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/sleekspace-ui.css +12844 -0
- package/dist/sleekspace-ui.es.js +19021 -0
- package/dist/sleekspace-ui.umd.js +19040 -0
- package/docs/components/accordion.md +92 -0
- package/docs/components/alert.md +72 -0
- package/docs/components/avatar.md +69 -0
- package/docs/components/breadcrumbs.md +65 -0
- package/docs/components/button/_meta.yaml +12 -0
- package/docs/components/button/accessibility.md +16 -0
- package/docs/components/button/custom-colors.md +18 -0
- package/docs/components/button/icons.md +31 -0
- package/docs/components/button/intro.md +8 -0
- package/docs/components/button/kinds.md +25 -0
- package/docs/components/button/sizes.md +14 -0
- package/docs/components/button/states.md +12 -0
- package/docs/components/button/usage.md +23 -0
- package/docs/components/button/variants.md +14 -0
- package/docs/components/button.md +110 -0
- package/docs/components/card.md +87 -0
- package/docs/components/checkbox.md +77 -0
- package/docs/components/collapsible.md +71 -0
- package/docs/components/divider.md +62 -0
- package/docs/components/dropdown.md +88 -0
- package/docs/components/field.md +80 -0
- package/docs/components/group.md +41 -0
- package/docs/components/input.md +84 -0
- package/docs/components/listbox.md +82 -0
- package/docs/components/modal.md +101 -0
- package/docs/components/navbar.md +64 -0
- package/docs/components/number-input.md +78 -0
- package/docs/components/page.md +77 -0
- package/docs/components/pagination.md +88 -0
- package/docs/components/panel.md +74 -0
- package/docs/components/popover.md +93 -0
- package/docs/components/progress.md +76 -0
- package/docs/components/radio.md +86 -0
- package/docs/components/sidebar.md +74 -0
- package/docs/components/skeleton.md +76 -0
- package/docs/components/slider.md +94 -0
- package/docs/components/spinner.md +59 -0
- package/docs/components/switch.md +97 -0
- package/docs/components/table.md +91 -0
- package/docs/components/tabs.md +108 -0
- package/docs/components/tag.md +75 -0
- package/docs/components/tags-input.md +88 -0
- package/docs/components/textarea.md +80 -0
- package/docs/components/theme.md +65 -0
- package/docs/components/toast.md +95 -0
- package/docs/components/tooltip.md +90 -0
- package/docs/guides/custom-colors.md +84 -0
- package/docs/guides/design-tokens.md +105 -0
- package/docs/guides/getting-started.md +144 -0
- package/docs/guides/installation.md +62 -0
- package/docs/guides/theming.md +101 -0
- package/package.json +76 -0
- package/src/components/Accordion/SkAccordion.vue +133 -0
- package/src/components/Accordion/SkAccordionItem.vue +131 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/Accordion/types.ts +9 -0
- package/src/components/Alert/SkAlert.vue +137 -0
- package/src/components/Alert/types.ts +10 -0
- package/src/components/Avatar/SkAvatar.vue +141 -0
- package/src/components/Avatar/index.ts +8 -0
- package/src/components/Avatar/types.ts +31 -0
- package/src/components/Breadcrumbs/SkBreadcrumbItem.vue +76 -0
- package/src/components/Breadcrumbs/SkBreadcrumbSeparator.vue +38 -0
- package/src/components/Breadcrumbs/SkBreadcrumbs.vue +93 -0
- package/src/components/Breadcrumbs/index.ts +10 -0
- package/src/components/Breadcrumbs/types.ts +36 -0
- package/src/components/Button/SkButton.vue +148 -0
- package/src/components/Button/types.ts +21 -0
- package/src/components/Card/SkCard.vue +144 -0
- package/src/components/Card/types.ts +12 -0
- package/src/components/Checkbox/SkCheckbox.vue +136 -0
- package/src/components/Checkbox/index.ts +8 -0
- package/src/components/Checkbox/types.ts +10 -0
- package/src/components/Collapsible/SkCollapsible.vue +159 -0
- package/src/components/Collapsible/index.ts +2 -0
- package/src/components/Collapsible/types.ts +8 -0
- package/src/components/Divider/SkDivider.vue +63 -0
- package/src/components/Divider/types.ts +15 -0
- package/src/components/Dropdown/SkDropdown.vue +150 -0
- package/src/components/Dropdown/SkDropdownMenuItem.vue +58 -0
- package/src/components/Dropdown/SkDropdownMenuSeparator.vue +26 -0
- package/src/components/Dropdown/SkDropdownSubmenu.vue +107 -0
- package/src/components/Dropdown/index.ts +11 -0
- package/src/components/Dropdown/types.ts +11 -0
- package/src/components/Field/SkField.vue +152 -0
- package/src/components/Field/index.ts +8 -0
- package/src/components/Field/types.ts +7 -0
- package/src/components/Group/SkGroup.vue +52 -0
- package/src/components/Group/types.ts +10 -0
- package/src/components/Input/SkInput.vue +117 -0
- package/src/components/Input/index.ts +8 -0
- package/src/components/Input/types.ts +11 -0
- package/src/components/Listbox/SkListbox.vue +164 -0
- package/src/components/Listbox/SkListboxItem.vue +68 -0
- package/src/components/Listbox/SkListboxSeparator.vue +26 -0
- package/src/components/Listbox/index.ts +10 -0
- package/src/components/Listbox/types.ts +10 -0
- package/src/components/Modal/SkModal.vue +231 -0
- package/src/components/Modal/index.ts +8 -0
- package/src/components/Modal/types.ts +12 -0
- package/src/components/NavBar/SkNavBar.vue +83 -0
- package/src/components/NavBar/index.ts +8 -0
- package/src/components/NavBar/types.ts +15 -0
- package/src/components/NumberInput/SkNumberInput.vue +168 -0
- package/src/components/NumberInput/index.ts +8 -0
- package/src/components/NumberInput/types.ts +10 -0
- package/src/components/Page/SkPage.vue +94 -0
- package/src/components/Page/index.ts +8 -0
- package/src/components/Page/types.ts +21 -0
- package/src/components/Pagination/SkPagination.vue +185 -0
- package/src/components/Pagination/SkPaginationItem.vue +107 -0
- package/src/components/Pagination/index.ts +9 -0
- package/src/components/Pagination/types.ts +40 -0
- package/src/components/Panel/SkPanel.vue +96 -0
- package/src/components/Panel/types.ts +15 -0
- package/src/components/Popover/SkPopover.vue +185 -0
- package/src/components/Popover/index.ts +8 -0
- package/src/components/Popover/types.ts +11 -0
- package/src/components/Progress/SkProgress.vue +144 -0
- package/src/components/Progress/index.ts +8 -0
- package/src/components/Progress/types.ts +34 -0
- package/src/components/Radio/SkRadio.vue +110 -0
- package/src/components/Radio/SkRadioGroup.vue +92 -0
- package/src/components/Radio/index.ts +9 -0
- package/src/components/Radio/types.ts +11 -0
- package/src/components/Sidebar/README.md +405 -0
- package/src/components/Sidebar/SkSidebar.vue +88 -0
- package/src/components/Sidebar/SkSidebarItem.vue +58 -0
- package/src/components/Sidebar/SkSidebarSection.vue +40 -0
- package/src/components/Sidebar/types.ts +3 -0
- package/src/components/Skeleton/SkSkeleton.vue +171 -0
- package/src/components/Skeleton/index.ts +8 -0
- package/src/components/Skeleton/types.ts +31 -0
- package/src/components/Slider/SkSlider.vue +165 -0
- package/src/components/Slider/index.ts +8 -0
- package/src/components/Slider/types.ts +44 -0
- package/src/components/Spinner/SkSpinner.vue +105 -0
- package/src/components/Spinner/index.ts +8 -0
- package/src/components/Spinner/types.ts +28 -0
- package/src/components/Switch/SkSwitch.vue +215 -0
- package/src/components/Switch/index.ts +8 -0
- package/src/components/Switch/types.ts +12 -0
- package/src/components/Table/SkTable.vue +109 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Table/types.ts +15 -0
- package/src/components/Tabs/README.md +331 -0
- package/src/components/Tabs/SkTab.vue +84 -0
- package/src/components/Tabs/SkTabList.vue +62 -0
- package/src/components/Tabs/SkTabPanel.vue +47 -0
- package/src/components/Tabs/SkTabPanels.vue +23 -0
- package/src/components/Tabs/SkTabs.vue +124 -0
- package/src/components/Tabs/types.ts +21 -0
- package/src/components/Tag/SkTag.vue +129 -0
- package/src/components/Tag/types.ts +15 -0
- package/src/components/TagsInput/SkTagsInput.vue +184 -0
- package/src/components/TagsInput/index.ts +8 -0
- package/src/components/TagsInput/types.ts +10 -0
- package/src/components/Textarea/SkTextarea.vue +117 -0
- package/src/components/Textarea/index.ts +8 -0
- package/src/components/Textarea/types.ts +10 -0
- package/src/components/Theme/SkTheme.vue +47 -0
- package/src/components/Theme/types.ts +17 -0
- package/src/components/Theme/useTheme.ts +131 -0
- package/src/components/Toast/SkToast.vue +156 -0
- package/src/components/Toast/SkToastProvider.vue +180 -0
- package/src/components/Toast/index.ts +15 -0
- package/src/components/Toast/types.ts +63 -0
- package/src/components/Toast/useToast.ts +78 -0
- package/src/components/Tooltip/SkTooltip.vue +162 -0
- package/src/components/Tooltip/SkTooltipProvider.vue +114 -0
- package/src/components/Tooltip/index.ts +9 -0
- package/src/components/Tooltip/types.ts +13 -0
- package/src/composables/useCustomColors.test.ts +505 -0
- package/src/composables/useCustomColors.ts +124 -0
- package/src/composables/usePortalContext.test.ts +402 -0
- package/src/composables/usePortalContext.ts +95 -0
- package/src/global.d.ts +76 -0
- package/src/index.ts +259 -0
- package/src/styles/_scrollbar.scss +100 -0
- package/src/styles/base/_fonts.scss +105 -0
- package/src/styles/base/_global.scss +47 -0
- package/src/styles/base/_index.scss +24 -0
- package/src/styles/base/_reset.scss +11 -0
- package/src/styles/base/_typography.scss +178 -0
- package/src/styles/components/_accordion.scss +250 -0
- package/src/styles/components/_alert.scss +239 -0
- package/src/styles/components/_avatar.scss +133 -0
- package/src/styles/components/_breadcrumbs.scss +137 -0
- package/src/styles/components/_button.scss +731 -0
- package/src/styles/components/_card.scss +141 -0
- package/src/styles/components/_checkbox.scss +232 -0
- package/src/styles/components/_collapsible.scss +158 -0
- package/src/styles/components/_divider.scss +121 -0
- package/src/styles/components/_field.scss +87 -0
- package/src/styles/components/_group.scss +138 -0
- package/src/styles/components/_index.scss +46 -0
- package/src/styles/components/_input.scss +205 -0
- package/src/styles/components/_listbox.scss +453 -0
- package/src/styles/components/_menu.scss +216 -0
- package/src/styles/components/_modal.scss +329 -0
- package/src/styles/components/_navbar.scss +258 -0
- package/src/styles/components/_number-input.scss +352 -0
- package/src/styles/components/_page.scss +98 -0
- package/src/styles/components/_pagination.scss +411 -0
- package/src/styles/components/_panel.scss +281 -0
- package/src/styles/components/_popover.scss +258 -0
- package/src/styles/components/_progress.scss +280 -0
- package/src/styles/components/_radio.scss +255 -0
- package/src/styles/components/_sidebar.scss +92 -0
- package/src/styles/components/_skeleton.scss +138 -0
- package/src/styles/components/_slider.scss +262 -0
- package/src/styles/components/_spinner.scss +331 -0
- package/src/styles/components/_switch.scss +370 -0
- package/src/styles/components/_table.scss +405 -0
- package/src/styles/components/_tabs.scss +486 -0
- package/src/styles/components/_tag.scss +425 -0
- package/src/styles/components/_tags-input.scss +279 -0
- package/src/styles/components/_textarea.scss +208 -0
- package/src/styles/components/_toast.scss +331 -0
- package/src/styles/components/_tooltip.scss +206 -0
- package/src/styles/fonts/Titillium_Web/OFL.txt +93 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf +0 -0
- package/src/styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf +0 -0
- package/src/styles/index.scss +17 -0
- package/src/styles/mixins/_cut-border.scss +254 -0
- package/src/styles/mixins/_index.scss +7 -0
- package/src/styles/theme/_variables.scss +42 -0
- package/src/styles/themes/README.md +127 -0
- package/src/styles/themes/_colorful.scss +58 -0
- package/src/styles/themes/_greyscale.scss +58 -0
- package/src/styles/themes/index.scss +9 -0
- package/src/styles/tokens/README.md +268 -0
- package/src/styles/tokens/_foundation-borders.scss +26 -0
- package/src/styles/tokens/_foundation-colors.scss +169 -0
- package/src/styles/tokens/_foundation-glow.scss +36 -0
- package/src/styles/tokens/_foundation-radius.scss +53 -0
- package/src/styles/tokens/_foundation-scrollbar.scss +31 -0
- package/src/styles/tokens/_foundation-shadows.scss +37 -0
- package/src/styles/tokens/_foundation-space.scss +36 -0
- package/src/styles/tokens/_foundation-transitions.scss +37 -0
- package/src/styles/tokens/_foundation-typography.scss +58 -0
- package/src/styles/tokens/_semantic-color-kinds.scss +112 -0
- package/src/styles/tokens/_semantic-colors.scss +10 -0
- package/src/styles/tokens/_semantic-interactive.scss +29 -0
- package/src/styles/tokens/_semantic-scrollbar.scss +48 -0
- package/src/styles/tokens/_semantic-surfaces.scss +36 -0
- package/src/styles/tokens/index.scss +38 -0
- package/src/styles/tokens.scss +268 -0
- package/src/styles/utilities/_index.scss +9 -0
- package/src/styles/utilities/_typography.scss +121 -0
- package/src/types.ts +50 -0
- package/web-types.json +3524 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: SkTagsInput
|
|
3
|
+
category: Forms
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkTagsInput
|
|
7
|
+
|
|
8
|
+
A multi-value tag input component for entering a list of string values. Type text and press Enter to add tags; use Backspace or the delete button to remove them. Built on RekaUI's TagsInput primitive.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```vue
|
|
13
|
+
<script setup>
|
|
14
|
+
import { ref } from 'vue';
|
|
15
|
+
|
|
16
|
+
const tags = ref(['vue', 'typescript']);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<SkTagsInput v-model="tags" placeholder="Add tag..." kind="primary" />
|
|
21
|
+
</template>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Max Tags
|
|
25
|
+
|
|
26
|
+
Limit the number of tags. The input field disables when the limit is reached, but existing tags can still be removed:
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<SkTagsInput v-model="tags" :max="5" />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Paste Support
|
|
33
|
+
|
|
34
|
+
By default, pasting text adds tags (splitting on common delimiters). Disable with:
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<SkTagsInput v-model="tags" :add-on-paste="false" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Tag Styling
|
|
41
|
+
|
|
42
|
+
Control the appearance of the tag badges within the input:
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<SkTagsInput
|
|
46
|
+
v-model="tags"
|
|
47
|
+
kind="primary"
|
|
48
|
+
tag-kind="accent"
|
|
49
|
+
tag-variant="outline"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Kinds
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<SkTagsInput v-model="tags" kind="primary" />
|
|
57
|
+
<SkTagsInput v-model="tags" kind="accent" />
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
When nested inside SkField, the kind is automatically injected.
|
|
61
|
+
|
|
62
|
+
## Sizes
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<SkTagsInput v-model="tags" size="sm" />
|
|
66
|
+
<SkTagsInput v-model="tags" size="md" />
|
|
67
|
+
<SkTagsInput v-model="tags" size="lg" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## States
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<SkTagsInput v-model="tags" disabled />
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Custom Colors
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<SkTagsInput
|
|
80
|
+
v-model="tags"
|
|
81
|
+
base-color="oklch(0.5 0.2 260)"
|
|
82
|
+
text-color="white"
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Accessibility
|
|
87
|
+
|
|
88
|
+
Built on RekaUI TagsInput which provides keyboard management: Enter adds a tag, Backspace removes the last tag when the input is empty, and Delete buttons on individual tags are keyboard-accessible.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: SkTextarea
|
|
3
|
+
category: Forms
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkTextarea
|
|
7
|
+
|
|
8
|
+
A multiline text input component with validation states and semantic color support. Automatically inherits kind from a parent SkField.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```vue
|
|
13
|
+
<script setup>
|
|
14
|
+
import { ref } from 'vue';
|
|
15
|
+
|
|
16
|
+
const message = ref('');
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<SkTextarea v-model="message" placeholder="Write your message..." :rows="6" />
|
|
21
|
+
</template>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Rows
|
|
25
|
+
|
|
26
|
+
Control the visible height with the `rows` prop (default: 4):
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<SkTextarea v-model="val" :rows="8" />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Kinds
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<SkTextarea v-model="val" kind="success" placeholder="Valid" />
|
|
36
|
+
<SkTextarea v-model="val" kind="danger" placeholder="Invalid" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
When nested inside SkField, the kind is automatically injected based on field validation state.
|
|
40
|
+
|
|
41
|
+
## Sizes
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<SkTextarea v-model="val" size="sm" />
|
|
45
|
+
<SkTextarea v-model="val" size="md" />
|
|
46
|
+
<SkTextarea v-model="val" size="lg" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## States
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<SkTextarea v-model="val" disabled placeholder="Disabled" />
|
|
53
|
+
<SkTextarea v-model="val" readonly />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Custom Colors
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<SkTextarea
|
|
60
|
+
v-model="val"
|
|
61
|
+
base-color="oklch(0.5 0.15 260)"
|
|
62
|
+
text-color="white"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Composition
|
|
67
|
+
|
|
68
|
+
Pair with SkField for labels, descriptions, and error messages:
|
|
69
|
+
|
|
70
|
+
```vue
|
|
71
|
+
<SkField label="Bio" description="Tell us about yourself." :error="bioError">
|
|
72
|
+
<template #default="{ id, ...attrs }">
|
|
73
|
+
<SkTextarea :id="id" v-bind="attrs" v-model="bio" :rows="4" />
|
|
74
|
+
</template>
|
|
75
|
+
</SkField>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Accessibility
|
|
79
|
+
|
|
80
|
+
Renders as a native `<textarea>` element. All standard HTML attributes are forwarded via `v-bind="$attrs"`. Use SkField to associate labels and error messages via `aria-describedby` and `aria-invalid`.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: SkTheme
|
|
3
|
+
category: Theming
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkTheme
|
|
7
|
+
|
|
8
|
+
A theme provider component that controls the color scheme for all child components. Sets a `data-scheme` attribute that CSS rules use to apply different semantic token values.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```vue
|
|
13
|
+
<template>
|
|
14
|
+
<SkTheme theme="colorful">
|
|
15
|
+
<SkPanel kind="primary">
|
|
16
|
+
<SkButton kind="accent">Themed Button</SkButton>
|
|
17
|
+
</SkPanel>
|
|
18
|
+
</SkTheme>
|
|
19
|
+
</template>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Available Themes
|
|
23
|
+
|
|
24
|
+
- **greyscale** (default) -- Monochromatic palette.
|
|
25
|
+
- **colorful** -- Vibrant cyberpunk colors.
|
|
26
|
+
|
|
27
|
+
Custom theme names can be used if matching CSS custom property overrides are defined under the corresponding `[data-scheme="..."]` selector.
|
|
28
|
+
|
|
29
|
+
## Nested Themes
|
|
30
|
+
|
|
31
|
+
Themes can be nested. The inner SkTheme overrides the outer one for its subtree:
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<SkTheme theme="greyscale">
|
|
35
|
+
<SkButton kind="primary">Greyscale</SkButton>
|
|
36
|
+
|
|
37
|
+
<SkTheme theme="colorful">
|
|
38
|
+
<SkButton kind="primary">Colorful</SkButton>
|
|
39
|
+
</SkTheme>
|
|
40
|
+
</SkTheme>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Programmatic Switching
|
|
44
|
+
|
|
45
|
+
The `useTheme` composable enables runtime theme changes:
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<script setup>
|
|
49
|
+
import { useTheme } from '@skewedaspect/sleekspace-ui';
|
|
50
|
+
|
|
51
|
+
const { currentTheme, setTheme } = useTheme();
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<SkButton @click="setTheme('colorful')">Go Colorful</SkButton>
|
|
56
|
+
</template>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Portal Components
|
|
60
|
+
|
|
61
|
+
SkTheme provides the current theme value via Vue's provide/inject system. Portal components (SkModal, SkDropdown, SkListbox, SkTooltip, SkPopover, SkToast) automatically consume this value and apply `data-scheme` on their portaled content so they inherit the correct theme.
|
|
62
|
+
|
|
63
|
+
## Accessibility
|
|
64
|
+
|
|
65
|
+
SkTheme is a transparent wrapper that does not affect the DOM semantics. It renders a single `<div>` with a `data-scheme` attribute.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: SkToast
|
|
3
|
+
category: Feedback
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkToast
|
|
7
|
+
|
|
8
|
+
A notification toast system for showing brief messages that appear and auto-dismiss. Composed of SkToastProvider (wraps your app) and the `useToast` composable (shows toasts from anywhere). Built on RekaUI's Toast primitive.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Wrap your application with SkToastProvider, then use `useToast()` to show notifications:
|
|
13
|
+
|
|
14
|
+
```vue
|
|
15
|
+
<!-- App.vue -->
|
|
16
|
+
<template>
|
|
17
|
+
<SkToastProvider position="top-right">
|
|
18
|
+
<RouterView />
|
|
19
|
+
</SkToastProvider>
|
|
20
|
+
</template>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<!-- AnyComponent.vue -->
|
|
25
|
+
<script setup>
|
|
26
|
+
import { useToast } from '@skewedaspect/sleekspace-ui';
|
|
27
|
+
|
|
28
|
+
const toast = useToast();
|
|
29
|
+
|
|
30
|
+
function save() {
|
|
31
|
+
toast.add({
|
|
32
|
+
kind: 'success',
|
|
33
|
+
title: 'Saved',
|
|
34
|
+
message: 'Your changes have been saved.',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<SkButton @click="save">Save</SkButton>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Toast Options
|
|
45
|
+
|
|
46
|
+
The `toast.add()` method accepts:
|
|
47
|
+
|
|
48
|
+
- **kind** -- `info` (default), `success`, `warning`, `danger`.
|
|
49
|
+
- **title** -- Optional heading text.
|
|
50
|
+
- **message** -- Required message content.
|
|
51
|
+
- **duration** -- Auto-dismiss time in ms. Use `0` for no auto-dismiss. Defaults to the provider's duration (5000ms).
|
|
52
|
+
- **closable** -- Show a close button (default: `true`).
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
toast.add({
|
|
56
|
+
kind: 'danger',
|
|
57
|
+
title: 'Error',
|
|
58
|
+
message: 'Something went wrong.',
|
|
59
|
+
duration: 0,
|
|
60
|
+
closable: true,
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Dismissing Toasts
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
const id = toast.add({ message: 'Processing...' });
|
|
68
|
+
toast.dismiss(id); // Dismiss specific toast
|
|
69
|
+
toast.dismissAll(); // Dismiss all toasts
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Position
|
|
73
|
+
|
|
74
|
+
Set the viewport position on the provider:
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<SkToastProvider position="top-right">...</SkToastProvider>
|
|
78
|
+
<SkToastProvider position="bottom-center">...</SkToastProvider>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Available positions: `top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center`, `bottom-right`.
|
|
82
|
+
|
|
83
|
+
## Swipe to Dismiss
|
|
84
|
+
|
|
85
|
+
Configure swipe behavior on the provider:
|
|
86
|
+
|
|
87
|
+
```vue
|
|
88
|
+
<SkToastProvider swipe-direction="left" :swipe-threshold="100">
|
|
89
|
+
...
|
|
90
|
+
</SkToastProvider>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Accessibility
|
|
94
|
+
|
|
95
|
+
Built on RekaUI Toast which renders notifications in a live region. Toasts are announced by screen readers as they appear. The `F8` hotkey (configurable via `hotkey` prop) focuses the toast viewport. Close buttons have `aria-label="Close"`. Content is portaled and inherits the active theme.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: SkTooltip
|
|
3
|
+
category: Feedback
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkTooltip
|
|
7
|
+
|
|
8
|
+
A hover-triggered tooltip for displaying brief supplementary information next to a trigger element. Supports standalone and provider modes for coordinated tooltip behavior. Built on RekaUI's Tooltip primitive and uses a portal.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```vue
|
|
13
|
+
<template>
|
|
14
|
+
<SkTooltip>
|
|
15
|
+
<template #trigger>
|
|
16
|
+
<SkButton>Hover me</SkButton>
|
|
17
|
+
</template>
|
|
18
|
+
This is the tooltip content.
|
|
19
|
+
</SkTooltip>
|
|
20
|
+
</template>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Standalone vs Provider Mode
|
|
24
|
+
|
|
25
|
+
By default, each SkTooltip manages its own show delay. Wrap multiple tooltips in SkTooltipProvider for coordinated "skip delay" behavior -- after viewing one tooltip, moving to another shows it instantly:
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<SkTooltipProvider :delay-duration="300">
|
|
29
|
+
<SkTooltip>
|
|
30
|
+
<template #trigger><SkButton>A</SkButton></template>
|
|
31
|
+
Tooltip A
|
|
32
|
+
</SkTooltip>
|
|
33
|
+
<SkTooltip>
|
|
34
|
+
<template #trigger><SkButton>B</SkButton></template>
|
|
35
|
+
Tooltip B
|
|
36
|
+
</SkTooltip>
|
|
37
|
+
</SkTooltipProvider>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Positioning
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<SkTooltip side="right" align="start" :side-offset="8">
|
|
44
|
+
<template #trigger><SkButton>Right</SkButton></template>
|
|
45
|
+
Positioned to the right.
|
|
46
|
+
</SkTooltip>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Available `side` values: `top` (default), `right`, `bottom`, `left`. Available `align` values: `start`, `center` (default), `end`.
|
|
50
|
+
|
|
51
|
+
## Arrow
|
|
52
|
+
|
|
53
|
+
The arrow is shown by default. Hide it with:
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<SkTooltip :show-arrow="false">...</SkTooltip>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Variants
|
|
60
|
+
|
|
61
|
+
- **solid** (default) -- Filled background.
|
|
62
|
+
- **outline** -- Bordered with transparent background.
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<SkTooltip variant="solid">...</SkTooltip>
|
|
66
|
+
<SkTooltip variant="outline">...</SkTooltip>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Kinds
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<SkTooltip kind="primary">...</SkTooltip>
|
|
73
|
+
<SkTooltip kind="danger">...</SkTooltip>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Custom Colors
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<SkTooltip
|
|
80
|
+
base-color="oklch(0.3 0.1 260)"
|
|
81
|
+
text-color="white"
|
|
82
|
+
>
|
|
83
|
+
<template #trigger><SkButton>Info</SkButton></template>
|
|
84
|
+
Dark purple tooltip.
|
|
85
|
+
</SkTooltip>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Accessibility
|
|
89
|
+
|
|
90
|
+
Built on RekaUI Tooltip which shows on focus and hover, hides on Escape. The trigger receives `aria-describedby` pointing to the tooltip content. Content is portaled and inherits the active theme.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Custom Colors
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Custom Colors
|
|
6
|
+
|
|
7
|
+
All visual SleekSpace components support `baseColor` and `textColor` props for one-off color overrides that bypass the semantic kind system.
|
|
8
|
+
|
|
9
|
+
## baseColor and textColor Props
|
|
10
|
+
|
|
11
|
+
Pass any valid CSS color value to override a component's colors:
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<template>
|
|
15
|
+
<!-- OKLCH color -->
|
|
16
|
+
<SkButton
|
|
17
|
+
base-color="oklch(0.7 0.25 300)"
|
|
18
|
+
text-color="white"
|
|
19
|
+
>
|
|
20
|
+
Purple Button
|
|
21
|
+
</SkButton>
|
|
22
|
+
|
|
23
|
+
<!-- Hex color -->
|
|
24
|
+
<SkPanel base-color="#1e40af" text-color="#e0f2fe">
|
|
25
|
+
Custom blue panel
|
|
26
|
+
</SkPanel>
|
|
27
|
+
|
|
28
|
+
<!-- CSS variable -->
|
|
29
|
+
<SkAlert base-color="var(--my-brand-color)">
|
|
30
|
+
Brand-colored alert
|
|
31
|
+
</SkAlert>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Accepted formats include hex, RGB, HSL, OKLCH, named CSS colors, and CSS custom properties.
|
|
36
|
+
|
|
37
|
+
## How It Works
|
|
38
|
+
|
|
39
|
+
When `baseColor` is provided, the component sets CSS custom properties on its root element via the `useCustomColors` composable. These override the semantic token values that the component's SCSS normally references.
|
|
40
|
+
|
|
41
|
+
For a component named `button`, the composable sets:
|
|
42
|
+
|
|
43
|
+
- `--sk-button-color-base` from `baseColor`
|
|
44
|
+
- `--sk-button-fg` from `textColor`
|
|
45
|
+
|
|
46
|
+
If `textColor` is omitted, the component falls back to `--sk-neutral-text` from the active theme.
|
|
47
|
+
|
|
48
|
+
## Composable Usage (for custom components)
|
|
49
|
+
|
|
50
|
+
If you are building your own component and want the same custom color behavior, use the `useCustomColors` composable:
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<script setup>
|
|
54
|
+
import { toRef } from 'vue';
|
|
55
|
+
import { useCustomColors } from '@skewedaspect/sleekspace-ui';
|
|
56
|
+
|
|
57
|
+
const props = defineProps({
|
|
58
|
+
baseColor: String,
|
|
59
|
+
textColor: String,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const customColorStyles = useCustomColors(
|
|
63
|
+
'my-component',
|
|
64
|
+
toRef(() => props.baseColor),
|
|
65
|
+
toRef(() => props.textColor)
|
|
66
|
+
);
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<div :style="customColorStyles">
|
|
71
|
+
<slot />
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Interaction with kind
|
|
77
|
+
|
|
78
|
+
When both `kind` and `baseColor` are provided, `baseColor` takes precedence for color values. The `kind` class may still be applied for non-color styling, but the CSS custom properties from `baseColor`/`textColor` override the semantic token colors.
|
|
79
|
+
|
|
80
|
+
## Components Supporting Custom Colors
|
|
81
|
+
|
|
82
|
+
Nearly all visual components accept `baseColor` and `textColor`, including: SkButton, SkPanel, SkCard, SkAlert, SkTag, SkTabs, SkInput, SkCheckbox, SkSwitch, SkRadio, SkDropdown, SkListbox, SkModal, SkTooltip, SkPopover, SkNavBar, SkSidebar, SkBreadcrumbs, SkPagination, SkAccordion, SkCollapsible, SkTagsInput, SkTextarea, and SkNumberInput.
|
|
83
|
+
|
|
84
|
+
Some components use specialized color props instead (SkProgress uses `trackColor`, SkSlider uses `thumbColor`, SkSpinner uses `color`).
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design Tokens
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Design Tokens
|
|
6
|
+
|
|
7
|
+
SleekSpace UI uses a three-tier token hierarchy: Foundation, Semantic, and Component. This architecture enables consistent theming while allowing granular customization.
|
|
8
|
+
|
|
9
|
+
## Token Hierarchy
|
|
10
|
+
|
|
11
|
+
### Foundation Tokens
|
|
12
|
+
|
|
13
|
+
Primitive values that form the raw design vocabulary. These do not change with themes.
|
|
14
|
+
|
|
15
|
+
- **Colors** (OKLCH): 10 hues (gray, blue, red, orange, yellow, green, mint, cyan, purple, pink) with 11 shades each (5 through 95). Pattern: `--sk-color-{hue}-{shade}`.
|
|
16
|
+
- **Spacing**: `--sk-spacing-{xs|sm|md|lg|xl|2xl|3xl|4xl}`
|
|
17
|
+
- **Radii**: `--sk-radius-{none|sm|md|lg|xl|2xl|full}`
|
|
18
|
+
- **Border Widths**: `--sk-border-width-{thin|base|thick}`
|
|
19
|
+
- **Shadows**: `--sk-shadow-{sm|md|lg|xl|2xl}`
|
|
20
|
+
- **Glow Effects**: `--sk-glow-{sm|md|lg}`
|
|
21
|
+
- **Typography**: Font families, sizes, weights, line heights
|
|
22
|
+
- **Transitions**: `--sk-transition-duration-{fast|base|slow}`
|
|
23
|
+
|
|
24
|
+
### Semantic Tokens
|
|
25
|
+
|
|
26
|
+
Context-aware tokens that map to foundation values and change with the active theme. Use these for all component colors.
|
|
27
|
+
|
|
28
|
+
Pattern: `--sk-{kind}-{property}`
|
|
29
|
+
|
|
30
|
+
Each of the 7 semantic kinds (neutral, primary, accent, info, success, warning, danger) defines:
|
|
31
|
+
|
|
32
|
+
- `--sk-{kind}-base` -- Background/base color
|
|
33
|
+
- `--sk-{kind}-text` -- Foreground/text color
|
|
34
|
+
- `--sk-{kind}-hover` -- Hover state color
|
|
35
|
+
|
|
36
|
+
### Component Tokens
|
|
37
|
+
|
|
38
|
+
Optional tokens scoped to individual components, defined inline in component SCSS files:
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
--sk-button-height-base: 2.5rem;
|
|
42
|
+
--sk-panel-padding: var(--sk-spacing-md);
|
|
43
|
+
--sk-navbar-height: 4rem;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Using Tokens in Custom CSS
|
|
47
|
+
|
|
48
|
+
### Semantic tokens for colors
|
|
49
|
+
|
|
50
|
+
```scss
|
|
51
|
+
.my-component {
|
|
52
|
+
background: var(--sk-primary-base);
|
|
53
|
+
color: var(--sk-primary-text);
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
background: var(--sk-primary-hover);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Foundation tokens for non-color properties
|
|
62
|
+
|
|
63
|
+
```scss
|
|
64
|
+
.my-component {
|
|
65
|
+
padding: var(--sk-spacing-md);
|
|
66
|
+
border-width: var(--sk-border-width-base);
|
|
67
|
+
box-shadow: var(--sk-shadow-md);
|
|
68
|
+
transition-duration: var(--sk-transition-duration-base);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### In JavaScript
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
const primaryColor = getComputedStyle(document.documentElement)
|
|
76
|
+
.getPropertyValue('--sk-primary-base');
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## OKLCH Color Space
|
|
80
|
+
|
|
81
|
+
All colors use OKLCH (Oklab Lightness Chroma Hue) for perceptually uniform results:
|
|
82
|
+
|
|
83
|
+
```css
|
|
84
|
+
--sk-primary-base: oklch(0.65 0.2 260);
|
|
85
|
+
/* 65% lightness, 0.2 chroma, 260 degrees hue (blue) */
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Runtime shade calculation uses relative OKLCH:
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
--color-sk-primary-70: oklch(from var(--sk-primary-base) calc(l * 0.70) c h);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Token Files
|
|
95
|
+
|
|
96
|
+
Foundation tokens are in `src/styles/tokens/`:
|
|
97
|
+
- `_foundation-colors.scss`
|
|
98
|
+
- `_foundation-spacing.scss`
|
|
99
|
+
- `_foundation-radius.scss`
|
|
100
|
+
- `_foundation-borders.scss`
|
|
101
|
+
- `_foundation-shadows.scss`
|
|
102
|
+
- `_foundation-typography.scss`
|
|
103
|
+
- `_foundation-transitions.scss`
|
|
104
|
+
|
|
105
|
+
Semantic tokens are in `_semantic-colors.scss`. Component tokens are defined inline in each component's SCSS file under `src/styles/components/`.
|