zabi-components 7.0.2 → 8.0.0
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/README.md +46 -3
- package/THEMING.md +255 -15
- package/dist/atoms/ActionPanel.svelte +12 -7
- package/dist/atoms/ActionPanel.svelte.d.ts +2 -0
- package/dist/atoms/Badge.svelte +93 -56
- package/dist/atoms/Badge.svelte.d.ts +15 -3
- package/dist/atoms/Button.svelte +49 -49
- package/dist/atoms/Button.svelte.d.ts +3 -0
- package/dist/atoms/Card.svelte +31 -28
- package/dist/atoms/Card.svelte.d.ts +5 -2
- package/dist/atoms/CardContent.svelte +10 -2
- package/dist/atoms/CardContent.svelte.d.ts +2 -0
- package/dist/atoms/CardFooter.svelte +10 -2
- package/dist/atoms/CardFooter.svelte.d.ts +2 -0
- package/dist/atoms/CardHeader.svelte +10 -2
- package/dist/atoms/CardHeader.svelte.d.ts +2 -0
- package/dist/atoms/Checkbox.svelte +4 -0
- package/dist/atoms/Checkbox.svelte.d.ts +2 -0
- package/dist/atoms/CodeBlock.svelte +15 -7
- package/dist/atoms/CodeBlock.svelte.d.ts +9 -3
- package/dist/atoms/ColorPicker.svelte +19 -9
- package/dist/atoms/ColorPicker.svelte.d.ts +3 -1
- package/dist/atoms/Container.svelte +2 -3
- package/dist/atoms/Divider.svelte +4 -4
- package/dist/atoms/FeatureCard.svelte +4 -3
- package/dist/atoms/Heading.svelte +56 -27
- package/dist/atoms/Heading.svelte.d.ts +17 -4
- package/dist/atoms/IconButton.svelte +30 -37
- package/dist/atoms/Input.svelte +26 -34
- package/dist/atoms/List.svelte +10 -2
- package/dist/atoms/List.svelte.d.ts +2 -0
- package/dist/atoms/ListItem.svelte +2 -2
- package/dist/atoms/ListItemLeading.svelte +4 -2
- package/dist/atoms/ListItemLeading.svelte.d.ts +1 -1
- package/dist/atoms/OptimizedImage.svelte +11 -2
- package/dist/atoms/OptimizedImage.svelte.d.ts +2 -0
- package/dist/atoms/Progress.svelte +4 -1
- package/dist/atoms/Progress.svelte.d.ts +2 -0
- package/dist/atoms/Radio.svelte +4 -0
- package/dist/atoms/Radio.svelte.d.ts +2 -0
- package/dist/atoms/Select.svelte +65 -67
- package/dist/atoms/Select.svelte.d.ts +4 -0
- package/dist/atoms/SelectionControl.svelte +5 -1
- package/dist/atoms/SelectionControl.svelte.d.ts +2 -0
- package/dist/atoms/Skeleton.svelte +5 -3
- package/dist/atoms/Table.svelte +2 -1
- package/dist/atoms/Text.svelte +34 -5
- package/dist/atoms/Text.svelte.d.ts +7 -1
- package/dist/atoms/Textarea.svelte +7 -6
- package/dist/atoms/ThemeToggle.svelte +17 -14
- package/dist/atoms/ThemeToggle.svelte.d.ts +2 -0
- package/dist/atoms/Toast.svelte +10 -8
- package/dist/atoms/Toggle.svelte +21 -13
- package/dist/atoms/Toggle.svelte.d.ts +7 -0
- package/dist/atoms/Tooltip.svelte +80 -22
- package/dist/atoms/Tooltip.svelte.d.ts +15 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +1 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/util/cn.d.ts +8 -0
- package/dist/components/util/cn.d.ts.map +1 -0
- package/dist/components/util/ssr-safe.d.ts +4 -4
- package/dist/components/util/ssr-safe.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -6
- package/dist/molecules/Alert.svelte +43 -64
- package/dist/molecules/Alert.svelte.d.ts +7 -1
- package/dist/molecules/ComponentDemo.svelte +10 -2
- package/dist/molecules/ComponentDemo.svelte.d.ts +2 -0
- package/dist/molecules/ContactForm.svelte +12 -2
- package/dist/molecules/ContactForm.svelte.d.ts +2 -0
- package/dist/molecules/Dropdown.svelte +40 -11
- package/dist/molecules/Dropdown.svelte.d.ts +4 -0
- package/dist/molecules/EmptyState.svelte +2 -1
- package/dist/molecules/Form.svelte +25 -14
- package/dist/molecules/Form.svelte.d.ts +13 -5
- package/dist/molecules/FormField.svelte +2 -1
- package/dist/molecules/Header.svelte +13 -3
- package/dist/molecules/Header.svelte.d.ts +2 -0
- package/dist/molecules/ImageUpload.svelte +54 -15
- package/dist/molecules/ImageUpload.svelte.d.ts +16 -5
- package/dist/molecules/Modal.svelte +110 -31
- package/dist/molecules/Modal.svelte.d.ts +9 -6
- package/dist/molecules/NavigationMenu.svelte +15 -3
- package/dist/molecules/NavigationMenu.svelte.d.ts +4 -0
- package/dist/molecules/NavigationMenuContent.svelte +36 -38
- package/dist/molecules/NavigationMenuContent.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuItem.svelte +10 -2
- package/dist/molecules/NavigationMenuItem.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuLink.svelte +10 -2
- package/dist/molecules/NavigationMenuLink.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuList.svelte +10 -2
- package/dist/molecules/NavigationMenuList.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuTrigger.svelte +16 -3
- package/dist/molecules/NavigationMenuTrigger.svelte.d.ts +2 -0
- package/dist/molecules/Page.svelte +8 -2
- package/dist/molecules/Page.svelte.d.ts +2 -0
- package/dist/molecules/PropsTable.svelte +6 -3
- package/dist/molecules/PropsTable.svelte.d.ts +2 -0
- package/dist/molecules/RadioGroup.svelte +5 -1
- package/dist/molecules/RadioGroup.svelte.d.ts +2 -0
- package/dist/molecules/Section.svelte +12 -4
- package/dist/molecules/Section.svelte.d.ts +3 -1
- package/dist/molecules/SidebarBrandHeader.svelte +13 -4
- package/dist/molecules/SidebarBrandHeader.svelte.d.ts +2 -0
- package/dist/molecules/SidebarFooter.svelte +12 -4
- package/dist/molecules/SidebarFooter.svelte.d.ts +2 -0
- package/dist/molecules/SidebarNavSection.svelte +12 -4
- package/dist/molecules/SidebarNavSection.svelte.d.ts +2 -0
- package/dist/molecules/SlideUp.svelte +85 -21
- package/dist/molecules/SlideUp.svelte.d.ts +5 -4
- package/dist/molecules/Tabs.svelte +25 -19
- package/dist/molecules/Tabs.svelte.d.ts +8 -4
- package/dist/molecules/Toaster.svelte +3 -2
- package/dist/molecules/ToasterToast.svelte +41 -10
- package/dist/molecules/ToasterToast.svelte.d.ts +2 -0
- package/dist/organisms/SidebarAccountPanel.svelte +4 -0
- package/dist/organisms/SidebarAccountPanel.svelte.d.ts +2 -0
- package/dist/organisms/SidebarNavigation.svelte +102 -59
- package/dist/organisms/SidebarNavigation.svelte.d.ts +2 -0
- package/dist/organisms/SidebarPanel.svelte +19 -11
- package/dist/organisms/SidebarPanel.svelte.d.ts +2 -0
- package/dist/organisms/SidebarShell.svelte +112 -0
- package/dist/organisms/SidebarShell.svelte.d.ts +52 -0
- package/dist/organisms/TopNavbar.svelte +88 -17
- package/dist/organisms/TopNavbar.svelte.d.ts +2 -0
- package/dist/organisms/index.d.ts +1 -0
- package/dist/organisms/index.js +1 -0
- package/dist/routes/lib/variant-utils.d.ts +26 -0
- package/dist/routes/lib/{variant-utils.ts → variant-utils.js} +15 -46
- package/dist/types/events.js +1 -0
- package/dist/types/index.js +3 -0
- package/dist/util/cn.d.ts +7 -0
- package/dist/util/cn.js +48 -0
- package/dist/util/ssr-safe.d.ts +4 -4
- package/dist/zabi-components-colors.css +2 -2
- package/dist/zabi-components-theme-dark-only.css +139 -92
- package/dist/zabi-components-theme-dark.css +139 -92
- package/dist/zabi-components-theme-only.css +268 -122
- package/dist/zabi-components-theme.css +268 -122
- package/dist/zabi-components.css +831 -883
- package/docs/lucide-icons.md +3 -1
- package/package.json +19 -24
- package/dist/lib/layout-width-tokens.d.ts +0 -17
- package/dist/lib/layout-width-tokens.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Button.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Button.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Input.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Input.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/List.d.ts +0 -3
- package/dist/lib/showcase/component-docs/List.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Modal.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Modal.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Radio.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Radio.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts +0 -3
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Skeleton.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Skeleton.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/_shared.d.ts +0 -12
- package/dist/lib/showcase/component-docs/_shared.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/index.d.ts +0 -4
- package/dist/lib/showcase/component-docs/index.d.ts.map +0 -1
- package/dist/lib/showcase/components-catalog.d.ts +0 -3
- package/dist/lib/showcase/components-catalog.d.ts.map +0 -1
- package/dist/lib/showcase/components-showcase-constants.d.ts +0 -89
- package/dist/lib/showcase/components-showcase-constants.d.ts.map +0 -1
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts +0 -15
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts.map +0 -1
- package/dist/routes/lib/focus-utils.d.ts +0 -12
- package/dist/routes/lib/focus-utils.ts +0 -110
- package/dist/routes/lib/ssr-safe.ts +0 -58
- package/scripts/fix-lucide-svelte-icon-dts.js +0 -35
package/docs/lucide-icons.md
CHANGED
|
@@ -21,4 +21,6 @@ Showcase and demo routes under this repo import additional icons (e.g. `CircleQu
|
|
|
21
21
|
|
|
22
22
|
## Typings for `@lucide/svelte/icons/*`
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
`@lucide/svelte` 0.544.x ships per-icon `.svelte.d.ts` files with a duplicate `type X = ReturnType<typeof X>` line that makes some TypeScript language services treat them as non-modules. This affects editor tooling only, not runtime or builds with `skipLibCheck`.
|
|
25
|
+
|
|
26
|
+
Since 8.0.0 the package **does not run any install scripts** in your project. If your editor reports missing icon exports such as `Check` or `Copy`, prefer importing per-icon paths (`@lucide/svelte/icons/check`), enable `skipLibCheck`, or upgrade `@lucide/svelte`. Contributors to this repo get the patch automatically via the dev-only `prepare` script.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zabi-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Svelte 5 UI components with TypeScript and Tailwind CSS v4. Accessible, easy to theme, works with SSR.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,17 +31,13 @@
|
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"import": "./dist/types/index.js"
|
|
33
33
|
},
|
|
34
|
-
"./react": {
|
|
35
|
-
"types": "./dist/react/index.d.ts",
|
|
36
|
-
"import": "./dist/react/index.js"
|
|
37
|
-
},
|
|
38
34
|
"./lib/ssr-safe": {
|
|
39
|
-
"types": "./dist/
|
|
40
|
-
"import": "./dist/
|
|
35
|
+
"types": "./dist/util/ssr-safe.d.ts",
|
|
36
|
+
"import": "./dist/util/ssr-safe.js"
|
|
41
37
|
},
|
|
42
38
|
"./lib/variant-utils": {
|
|
43
|
-
"types": "./dist/routes/lib/variant-utils.ts",
|
|
44
|
-
"import": "./dist/routes/lib/variant-utils.
|
|
39
|
+
"types": "./dist/routes/lib/variant-utils.d.ts",
|
|
40
|
+
"import": "./dist/routes/lib/variant-utils.js"
|
|
45
41
|
},
|
|
46
42
|
"./dist/zabi-components.css": "./dist/zabi-components.css",
|
|
47
43
|
"./dist/zabi-components-colors.css": "./dist/zabi-components-colors.css",
|
|
@@ -63,8 +59,7 @@
|
|
|
63
59
|
"THEME.md",
|
|
64
60
|
"THEMING.md",
|
|
65
61
|
"docs/theme-imports.md",
|
|
66
|
-
"docs/lucide-icons.md"
|
|
67
|
-
"scripts/fix-lucide-svelte-icon-dts.js"
|
|
62
|
+
"docs/lucide-icons.md"
|
|
68
63
|
],
|
|
69
64
|
"keywords": [
|
|
70
65
|
"svelte",
|
|
@@ -87,15 +82,15 @@
|
|
|
87
82
|
"dev": "vite dev",
|
|
88
83
|
"build": "vite build && npm run build:types",
|
|
89
84
|
"build:components": "svelte-package -o dist --input src/components",
|
|
90
|
-
"build:lib-files": "mkdir -p dist/routes/lib dist/types && cp src/components/
|
|
85
|
+
"build:lib-files": "mkdir -p dist/routes/lib dist/types && cp src/components/types/variants.ts dist/types/ && cp src/components/types/page.types.ts dist/types/ && tsc src/routes/lib/variant-utils.ts --declaration --module esnext --target es2020 --moduleResolution bundler --skipLibCheck --rootDir src --outDir .lib-tmp && cp .lib-tmp/routes/lib/variant-utils.js .lib-tmp/routes/lib/variant-utils.d.ts dist/routes/lib/ && rm -rf .lib-tmp",
|
|
91
86
|
"build:fix-imports": "node scripts/fix-package-imports.js",
|
|
92
87
|
"build:lib": "npm run build:css && npm run build:components && npm run build:lib-files && npm run build:fix-imports && npm run build:types && npm run build:css && node scripts/verify-build.js",
|
|
93
|
-
"sync:tokens": "node scripts/sync-theme-tokens.js",
|
|
94
|
-
"build:css": "npm run sync:tokens && node scripts/build-css.js && node scripts/validate-theme.js",
|
|
88
|
+
"sync:tokens": "node scripts/sync-theme-tokens.js && node scripts/generate-ramps.js && node scripts/generate-surfaces.js",
|
|
89
|
+
"build:css": "npm run sync:tokens && node scripts/build-css.js && node scripts/validate-theme.js && npm run check:design",
|
|
95
90
|
"check:tokens": "node scripts/check-token-violations.js",
|
|
96
|
-
"build:types": "tsc --project tsconfig.lib.json &&
|
|
91
|
+
"build:types": "tsc --project tsconfig.lib.json && node scripts/emit-components-types-runtime.js",
|
|
97
92
|
"preview": "vite preview",
|
|
98
|
-
"check": "svelte-check --tsconfig ./tsconfig.json && node scripts/check-component-imports.js && node scripts/check-layout-width.js",
|
|
93
|
+
"check": "svelte-check --tsconfig ./tsconfig.json && node scripts/check-component-imports.js && node scripts/check-layout-width.js && npm run check:design",
|
|
99
94
|
"storybook": "storybook dev -p 6006",
|
|
100
95
|
"build-storybook": "storybook build",
|
|
101
96
|
"test": "vitest run",
|
|
@@ -104,12 +99,16 @@
|
|
|
104
99
|
"test:e2e:smoke": "playwright test --grep @smoke",
|
|
105
100
|
"test:playwright": "npm run test:e2e",
|
|
106
101
|
"test:themes": "node --test tests/theme-output.test.js",
|
|
102
|
+
"prepare": "node scripts/fix-lucide-svelte-icon-dts.js",
|
|
107
103
|
"prepublishOnly": "npm run build:lib",
|
|
108
104
|
"publish:npm": "npm publish --access public --registry https://registry.npmjs.org/",
|
|
109
|
-
"
|
|
105
|
+
"check:ramps": "node scripts/check-ramp-lightness.js",
|
|
106
|
+
"check:contrast": "node scripts/check-contrast.js",
|
|
107
|
+
"check:geometry": "node scripts/check-control-geometry.js",
|
|
108
|
+
"check:design": "npm run check:ramps && npm run check:contrast && npm run check:geometry && npm run check:tokens"
|
|
110
109
|
},
|
|
111
110
|
"devDependencies": {
|
|
112
|
-
"@playwright/test": "^1.
|
|
111
|
+
"@playwright/test": "^1.63.0",
|
|
113
112
|
"@storybook/addon-docs": "^10.2.19",
|
|
114
113
|
"@storybook/sveltekit": "^10.2.19",
|
|
115
114
|
"@sveltejs/adapter-auto": "^7.0.0",
|
|
@@ -122,7 +121,6 @@
|
|
|
122
121
|
"@testing-library/user-event": "^14.6.1",
|
|
123
122
|
"@tsconfig/svelte": "^5.0.5",
|
|
124
123
|
"@types/node": "^24.5.2",
|
|
125
|
-
"@types/react": "^19.2.2",
|
|
126
124
|
"autoprefixer": "^10.4.17",
|
|
127
125
|
"culori": "^4.0.2",
|
|
128
126
|
"jsdom": "^29.0.2",
|
|
@@ -136,11 +134,11 @@
|
|
|
136
134
|
"vitest": "^3.2.4"
|
|
137
135
|
},
|
|
138
136
|
"dependencies": {
|
|
139
|
-
"@lucide/svelte": "^0.544.0"
|
|
137
|
+
"@lucide/svelte": "^0.544.0",
|
|
138
|
+
"tailwind-merge": "^3.7.0"
|
|
140
139
|
},
|
|
141
140
|
"peerDependencies": {
|
|
142
141
|
"@sveltejs/kit": "^2.0.0",
|
|
143
|
-
"react": "^18.0.0",
|
|
144
142
|
"svelte": "^5.43.8"
|
|
145
143
|
},
|
|
146
144
|
"peerDependenciesMeta": {
|
|
@@ -149,9 +147,6 @@
|
|
|
149
147
|
},
|
|
150
148
|
"@sveltejs/kit": {
|
|
151
149
|
"optional": true
|
|
152
|
-
},
|
|
153
|
-
"react": {
|
|
154
|
-
"optional": true
|
|
155
150
|
}
|
|
156
151
|
},
|
|
157
152
|
"overrides": {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Named aliases for layout widths that are otherwise enforced as literals in
|
|
3
|
-
* `scripts/layout-width-policy.js` (see `ARBITRARY_MAX_WIDTH`).
|
|
4
|
-
*
|
|
5
|
-
* **Sync rule:** values MUST match `ARBITRARY_MAX_WIDTH` keys exactly. After
|
|
6
|
-
* changing policy, update this file (or vice versa) and run `npm run check`.
|
|
7
|
-
*
|
|
8
|
-
* Prefer `<Container>` / `<Section>` `maxWidth` for screen tokens; use these
|
|
9
|
-
* only where a fixed arbitrary literal is still required (shell, demos).
|
|
10
|
-
*/
|
|
11
|
-
export declare const layoutArbitraryWidth: {
|
|
12
|
-
/** DOCS_CATALOG_SIDEBAR_CAP — mobile drawer cap for /components sidebar */
|
|
13
|
-
readonly docsCatalogSidebar: "max-w-[266px]";
|
|
14
|
-
/** SIDEBAR_APP_SHELL_RAIL — showcase app-shell sidebar column demo */
|
|
15
|
-
readonly showcaseSidebarRail: "max-w-[280px]";
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=layout-width-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-width-tokens.d.ts","sourceRoot":"","sources":["../../src/lib/layout-width-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;IAC7B,2EAA2E;;IAE3E,sEAAsE;;CAEhE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/Button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YAiDhB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/Input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YAmChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/List.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YAoNhB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YA+BhB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/Radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YAyEhB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavigation.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/SidebarNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAQ9D,eAAO,MAAM,GAAG,EAAE,YA2ChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/Skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,eAAO,MAAM,GAAG,EAAE,YA4EhB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ComponentCategory, ComponentDoc, ComponentDocExample } from "../../../types/page.types";
|
|
2
|
-
export declare function demoId(componentName: string, suffix: string): string;
|
|
3
|
-
export declare function defaultExample(componentName: string, example: Omit<ComponentDocExample, "demoId"> & {
|
|
4
|
-
demoId?: string;
|
|
5
|
-
}): ComponentDocExample;
|
|
6
|
-
export declare function makeDoc(doc: Omit<ComponentDoc, "defaultExample"> & {
|
|
7
|
-
defaultExample: Omit<ComponentDoc["defaultExample"], "demoId"> & {
|
|
8
|
-
demoId?: string;
|
|
9
|
-
};
|
|
10
|
-
}): ComponentDoc;
|
|
11
|
-
export declare function categoryDocId(category: ComponentCategory): string;
|
|
12
|
-
//# sourceMappingURL=_shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/_shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEtG,wBAAgB,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,cAAc,CAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE,mBAAmB,CAQrB;AAED,wBAAgB,OAAO,CACnB,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,GAAG;IACxC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,GAAG;QAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,GACF,YAAY,CAYd;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAEjE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/showcase/component-docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAoB9D,wBAAgB,gBAAgB,IAAI,YAAY,EAAE,CAEjD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAG5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-catalog.d.ts","sourceRoot":"","sources":["../../../src/lib/showcase/components-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAmjFjE,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export declare const categories: {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
description: string;
|
|
5
|
-
}[];
|
|
6
|
-
export declare const sampleCode = "function greet(name) {\n return `Hello, ${name}!`;\n}\n\nconsole.log(greet('World'));";
|
|
7
|
-
export declare const selectOptions: {
|
|
8
|
-
value: string;
|
|
9
|
-
label: string;
|
|
10
|
-
}[];
|
|
11
|
-
export declare const docsListItems: ({
|
|
12
|
-
id: string;
|
|
13
|
-
label: string;
|
|
14
|
-
description: string;
|
|
15
|
-
href: string;
|
|
16
|
-
disabled?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
id: string;
|
|
19
|
-
label: string;
|
|
20
|
-
description: string;
|
|
21
|
-
href?: undefined;
|
|
22
|
-
disabled?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
id: string;
|
|
25
|
-
label: string;
|
|
26
|
-
description: string;
|
|
27
|
-
href: string;
|
|
28
|
-
disabled: boolean;
|
|
29
|
-
})[];
|
|
30
|
-
export declare const sidebarNavItems: ({
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
href: string;
|
|
34
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
35
|
-
badgeCount?: undefined;
|
|
36
|
-
group?: undefined;
|
|
37
|
-
} | {
|
|
38
|
-
id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
href: string;
|
|
41
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
42
|
-
badgeCount: number;
|
|
43
|
-
group?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
id: string;
|
|
46
|
-
label: string;
|
|
47
|
-
href: string;
|
|
48
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
49
|
-
group: "secondary";
|
|
50
|
-
badgeCount?: undefined;
|
|
51
|
-
})[];
|
|
52
|
-
/** Richer nav for the “app shell” demo on the SidebarNavigation showcase page. */
|
|
53
|
-
export declare const sidebarAppShellDemoItems: ({
|
|
54
|
-
id: string;
|
|
55
|
-
label: string;
|
|
56
|
-
href: string;
|
|
57
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
58
|
-
section: string;
|
|
59
|
-
badgeCount?: undefined;
|
|
60
|
-
group?: undefined;
|
|
61
|
-
} | {
|
|
62
|
-
id: string;
|
|
63
|
-
label: string;
|
|
64
|
-
href: string;
|
|
65
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
66
|
-
section: string;
|
|
67
|
-
badgeCount: number;
|
|
68
|
-
group?: undefined;
|
|
69
|
-
} | {
|
|
70
|
-
id: string;
|
|
71
|
-
label: string;
|
|
72
|
-
href: string;
|
|
73
|
-
icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
|
|
74
|
-
group: "secondary";
|
|
75
|
-
section?: undefined;
|
|
76
|
-
badgeCount?: undefined;
|
|
77
|
-
})[];
|
|
78
|
-
export declare const sidebarProjectItems: ({
|
|
79
|
-
id: string;
|
|
80
|
-
label: string;
|
|
81
|
-
description: string;
|
|
82
|
-
badgeText: string;
|
|
83
|
-
} | {
|
|
84
|
-
id: string;
|
|
85
|
-
label: string;
|
|
86
|
-
description: string;
|
|
87
|
-
badgeText?: undefined;
|
|
88
|
-
})[];
|
|
89
|
-
//# sourceMappingURL=components-showcase-constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components-showcase-constants.d.ts","sourceRoot":"","sources":["../../../src/lib/showcase/components-showcase-constants.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU;;;;GAiBtB,CAAC;AAEF,eAAO,MAAM,UAAU,2FAIM,CAAC;AAE9B,eAAO,MAAM,aAAa;;;GAGvB,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;IAyBzB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;IAmB3B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;IAmDpC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;IAuB/B,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Component } from "svelte";
|
|
2
|
-
type SidebarNavIcon = Component<{
|
|
3
|
-
size?: number;
|
|
4
|
-
class?: string;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* Icon for a documentation sidebar category row.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getDocsCategoryIcon(categoryId: string): SidebarNavIcon;
|
|
10
|
-
/**
|
|
11
|
-
* Icon for a documentation sidebar component row.
|
|
12
|
-
*/
|
|
13
|
-
export declare function getDocsComponentIcon(componentName: string, componentCategory: string): SidebarNavIcon;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=docs-sidebar-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-sidebar-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/showcase/docs-sidebar-helpers.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,KAAK,cAAc,GAAG,SAAS,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAKtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,GAC1B,cAAc,CAgBhB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Focus helpers for overlays (modals, sheets). Requires `app.css` focus ring classes. */
|
|
2
|
-
/** From `app.css` `@layer components` — import the library/app stylesheet. */
|
|
3
|
-
export declare const FOCUS_BRAND_CLASS = "focus-brand";
|
|
4
|
-
export declare const FOCUS_NAV_CLASS = "focus-nav";
|
|
5
|
-
export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
6
|
-
/** Tab wraps first↔last inside `container`. Caller should pair with `saveFocus` / `returnFocus`. */
|
|
7
|
-
export declare function trapFocus(container: HTMLElement): () => void;
|
|
8
|
-
export declare function saveFocus(): void;
|
|
9
|
-
/** Restores focus from the last `saveFocus`. Skips disconnected or unfocusable nodes. */
|
|
10
|
-
export declare function returnFocus(): void;
|
|
11
|
-
export declare function focusFirstElement(container: HTMLElement): void;
|
|
12
|
-
//# sourceMappingURL=focus-utils.d.ts.map
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/** Focus helpers for overlays (modals, sheets). Requires `app.css` focus ring classes. */
|
|
2
|
-
|
|
3
|
-
/** From `app.css` `@layer components` — import the library/app stylesheet. */
|
|
4
|
-
export const FOCUS_BRAND_CLASS = "focus-brand";
|
|
5
|
-
export const FOCUS_NAV_CLASS = "focus-nav";
|
|
6
|
-
|
|
7
|
-
export function getFocusableElements(container: HTMLElement): HTMLElement[] {
|
|
8
|
-
const selector = [
|
|
9
|
-
'button:not([disabled])',
|
|
10
|
-
'[href]',
|
|
11
|
-
'input:not([disabled])',
|
|
12
|
-
'select:not([disabled])',
|
|
13
|
-
'textarea:not([disabled])',
|
|
14
|
-
'[tabindex]:not([tabindex="-1"])',
|
|
15
|
-
].join(', ');
|
|
16
|
-
|
|
17
|
-
return Array.from(container.querySelectorAll<HTMLElement>(selector)).filter(
|
|
18
|
-
(el) => {
|
|
19
|
-
const style = window.getComputedStyle(el);
|
|
20
|
-
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Tab wraps first↔last inside `container`. Caller should pair with `saveFocus` / `returnFocus`. */
|
|
26
|
-
export function trapFocus(container: HTMLElement): () => void {
|
|
27
|
-
const focusableElements = getFocusableElements(container);
|
|
28
|
-
|
|
29
|
-
if (focusableElements.length === 0) {
|
|
30
|
-
return () => {};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const firstElement = focusableElements[0];
|
|
34
|
-
const lastElement = focusableElements[focusableElements.length - 1];
|
|
35
|
-
|
|
36
|
-
firstElement.focus();
|
|
37
|
-
|
|
38
|
-
function handleKeydown(event: KeyboardEvent) {
|
|
39
|
-
if (event.key !== 'Tab') {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const currentFocus = document.activeElement as HTMLElement;
|
|
44
|
-
|
|
45
|
-
if (!focusableElements.includes(currentFocus)) {
|
|
46
|
-
event.preventDefault();
|
|
47
|
-
firstElement.focus();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (event.shiftKey) {
|
|
52
|
-
if (currentFocus === firstElement) {
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
lastElement.focus();
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
if (currentFocus === lastElement) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
firstElement.focus();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
container.addEventListener('keydown', handleKeydown);
|
|
65
|
-
|
|
66
|
-
return () => {
|
|
67
|
-
container.removeEventListener('keydown', handleKeydown);
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** One entry per overlay open; `returnFocus` pops LIFO (nested modals). */
|
|
72
|
-
const focusReturnStack: Array<HTMLElement | null> = [];
|
|
73
|
-
|
|
74
|
-
export function saveFocus(): void {
|
|
75
|
-
if (typeof document === 'undefined') {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const active = document.activeElement;
|
|
79
|
-
if (active instanceof HTMLElement && active !== document.body) {
|
|
80
|
-
focusReturnStack.push(active);
|
|
81
|
-
} else {
|
|
82
|
-
focusReturnStack.push(null);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** Restores focus from the last `saveFocus`. Skips disconnected or unfocusable nodes. */
|
|
87
|
-
export function returnFocus(): void {
|
|
88
|
-
if (typeof document === 'undefined') {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const el = focusReturnStack.pop();
|
|
92
|
-
if (!el) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (typeof el.focus !== 'function' || !el.isConnected) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
el.focus({ preventScroll: true });
|
|
100
|
-
} catch {
|
|
101
|
-
/* embeds / shadow roots may reject programmatic focus */
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function focusFirstElement(container: HTMLElement): void {
|
|
106
|
-
const focusableElements = getFocusableElements(container);
|
|
107
|
-
if (focusableElements.length > 0) {
|
|
108
|
-
focusableElements[0].focus();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-only guards and id generation for components that run under SSR.
|
|
3
|
-
* `generateId()` is non-deterministic on the client (random) vs counter on the server —
|
|
4
|
-
* use stable ids for ARIA pairs (e.g. `menuId` on NavigationMenu), not for persisted keys.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export function isBrowser(): boolean {
|
|
8
|
-
return typeof window !== 'undefined';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function safeWindow(): Window | undefined {
|
|
12
|
-
return isBrowser() ? window : undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function safeDocument(): Document | undefined {
|
|
16
|
-
return isBrowser() ? document : undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function safeLocalStorage(): Storage | undefined {
|
|
20
|
-
return isBrowser() ? localStorage : undefined;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function safeSessionStorage(): Storage | undefined {
|
|
24
|
-
return isBrowser() ? sessionStorage : undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function safeRequestAnimationFrame(callback: FrameRequestCallback): number | undefined {
|
|
28
|
-
return isBrowser() ? requestAnimationFrame(callback) : undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function safeSetTimeout(callback: () => void, delay: number): NodeJS.Timeout | undefined {
|
|
32
|
-
return isBrowser() ? setTimeout(callback, delay) : undefined;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function safeClearTimeout(id: NodeJS.Timeout | undefined): void {
|
|
36
|
-
if (isBrowser() && id) {
|
|
37
|
-
clearTimeout(id);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function safeSetInterval(callback: () => void, delay: number): NodeJS.Timeout | undefined {
|
|
42
|
-
return isBrowser() ? setInterval(callback, delay) : undefined;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function safeClearInterval(id: NodeJS.Timeout | undefined): void {
|
|
46
|
-
if (isBrowser() && id) {
|
|
47
|
-
clearInterval(id);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let idCounter = 0;
|
|
52
|
-
export function generateId(prefix: string = 'id'): string {
|
|
53
|
-
if (isBrowser()) {
|
|
54
|
-
return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
|
|
55
|
-
} else {
|
|
56
|
-
return `${prefix}-ssr-${++idCounter}`;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* @lucide/svelte (0.544.x) ships `dist/icons/*.svelte.d.ts` with a duplicate
|
|
4
|
-
* `type X = ReturnType<typeof X>` line that makes some TypeScript language
|
|
5
|
-
* services treat the file as a non-module; re-exports from the package root
|
|
6
|
-
* then fail (e.g. `Check` / `Copy` missing). Strip those lines after install.
|
|
7
|
-
*/
|
|
8
|
-
import fs from "fs";
|
|
9
|
-
import path from "path";
|
|
10
|
-
import { fileURLToPath } from "url";
|
|
11
|
-
|
|
12
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const iconsDir = path.join(__dirname, "..", "node_modules", "@lucide", "svelte", "dist", "icons");
|
|
14
|
-
|
|
15
|
-
const duplicateTypeLine = /\r?\ntype (\w+) = ReturnType<typeof \1>;\r?\n/g;
|
|
16
|
-
|
|
17
|
-
function fixFile(filePath) {
|
|
18
|
-
let text = fs.readFileSync(filePath, "utf8");
|
|
19
|
-
const next = text.replace(duplicateTypeLine, "\n");
|
|
20
|
-
if (next !== text) {
|
|
21
|
-
fs.writeFileSync(filePath, next);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function main() {
|
|
26
|
-
if (!fs.existsSync(iconsDir)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
for (const name of fs.readdirSync(iconsDir)) {
|
|
30
|
-
if (!name.endsWith(".svelte.d.ts")) continue;
|
|
31
|
-
fixFile(path.join(iconsDir, name));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
main();
|