@mich8060/unified-design-system 0.2.11 → 0.2.14
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 +8 -0
- package/dist/ai/audit/auditLogger.cjs +2 -0
- package/dist/ai/audit/auditLogger.js +2 -0
- package/dist/ai/discovery.json +33 -0
- package/dist/ai/examples/index.cjs +1 -0
- package/dist/ai/examples/index.js +1 -0
- package/dist/ai/examples/training.examples.cjs +1 -0
- package/dist/ai/examples/training.examples.js +1 -0
- package/dist/ai/examples/trees.example.cjs +1 -0
- package/dist/ai/examples/trees.example.js +1 -0
- package/dist/ai/examples/validation-run.example.cjs +1 -0
- package/dist/ai/examples/validation-run.example.js +1 -0
- package/dist/ai/index.cjs +1 -0
- package/dist/ai/index.js +1 -0
- package/dist/ai/manifest/components.manifest.cjs +1 -0
- package/dist/ai/manifest/components.manifest.js +1 -0
- package/dist/ai/manifest/composition.manifest.cjs +1 -0
- package/dist/ai/manifest/composition.manifest.js +1 -0
- package/dist/ai/manifest/governance.manifest.cjs +1 -0
- package/dist/ai/manifest/governance.manifest.js +1 -0
- package/dist/ai/manifest/index.cjs +1 -0
- package/dist/ai/manifest/index.js +1 -0
- package/dist/ai/manifest/layout.manifest.cjs +1 -0
- package/dist/ai/manifest/layout.manifest.js +1 -0
- package/dist/ai/manifest/patterns.manifest.cjs +1 -0
- package/dist/ai/manifest/patterns.manifest.js +1 -0
- package/dist/ai/manifest/prop-aliases.manifest.cjs +1 -0
- package/dist/ai/manifest/prop-aliases.manifest.js +1 -0
- package/dist/ai/manifest/system.manifest.cjs +1 -0
- package/dist/ai/manifest/system.manifest.js +1 -0
- package/dist/ai/manifest/tokens.intent.manifest.cjs +1 -0
- package/dist/ai/manifest/tokens.intent.manifest.js +1 -0
- package/dist/ai/manifest.json +2801 -0
- package/dist/ai/policies/policy.engine.cjs +1 -0
- package/dist/ai/policies/policy.engine.js +1 -0
- package/dist/ai/policies/rules/accessibility.rules.cjs +1 -0
- package/dist/ai/policies/rules/accessibility.rules.js +1 -0
- package/dist/ai/policies/rules/action.rules.cjs +1 -0
- package/dist/ai/policies/rules/action.rules.js +1 -0
- package/dist/ai/policies/rules/composition.rules.cjs +1 -0
- package/dist/ai/policies/rules/composition.rules.js +1 -0
- package/dist/ai/policies/rules/props.rules.cjs +1 -0
- package/dist/ai/policies/rules/props.rules.js +1 -0
- package/dist/ai/policies/rules/spacing.rules.cjs +1 -0
- package/dist/ai/policies/rules/spacing.rules.js +1 -0
- package/dist/ai/schemas/ai-output.schema.json +71 -0
- package/dist/ai/sdk/index.cjs +1 -0
- package/dist/ai/sdk/index.js +1 -0
- package/dist/ai/sdk/runtime-sdk.cjs +2 -0
- package/dist/ai/sdk/runtime-sdk.js +2 -0
- package/dist/ai/telemetry/usageMetrics.cjs +1 -0
- package/dist/ai/telemetry/usageMetrics.js +1 -0
- package/dist/ai/templates/layouts.json +181 -0
- package/dist/ai/validation/deterministicFeedback.cjs +1 -0
- package/dist/ai/validation/deterministicFeedback.js +1 -0
- package/dist/ai/validation/driftDetection.cjs +1 -0
- package/dist/ai/validation/driftDetection.js +1 -0
- package/dist/ai/validation/index.cjs +1 -0
- package/dist/ai/validation/index.js +1 -0
- package/dist/ai/validation/schemaValidation.cjs +1 -0
- package/dist/ai/validation/schemaValidation.js +1 -0
- package/dist/ai/validation/validateAIOutput.cjs +1 -0
- package/dist/ai/validation/validateAIOutput.js +1 -0
- package/dist/ai/validation/validateTree.cjs +1 -0
- package/dist/ai/validation/validateTree.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/DotStatus/DotStatus.cjs +1 -1
- package/dist/components/DotStatus/DotStatus.js +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.js +1 -1
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.cjs +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.cjs +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/dist/components/Steps/Steps.cjs +1 -1
- package/dist/components/Steps/Steps.js +1 -1
- package/dist/components/Text/Text.cjs +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/design-system/ai/audit/audit.types.d.ts +23 -0
- package/dist/design-system/ai/audit/auditLogger.d.ts +2 -0
- package/dist/design-system/ai/examples/index.d.ts +4 -0
- package/dist/design-system/ai/examples/training.examples.d.ts +22 -0
- package/dist/design-system/ai/examples/trees.example.d.ts +3 -0
- package/dist/design-system/ai/examples/validation-run.example.d.ts +3 -0
- package/dist/design-system/ai/index.d.ts +45 -0
- package/dist/design-system/ai/manifest/components.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/composition.manifest.d.ts +11 -0
- package/dist/design-system/ai/manifest/governance.manifest.d.ts +10 -0
- package/dist/design-system/ai/manifest/index.d.ts +9 -0
- package/dist/design-system/ai/manifest/layout.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/patterns.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/prop-aliases.manifest.d.ts +10 -0
- package/dist/design-system/ai/manifest/system.manifest.d.ts +5 -0
- package/dist/design-system/ai/manifest/tokens.intent.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/types.d.ts +136 -0
- package/dist/design-system/ai/policies/policy.engine.d.ts +3 -0
- package/dist/design-system/ai/policies/policy.types.d.ts +14 -0
- package/dist/design-system/ai/policies/rules/accessibility.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/action.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/composition.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/props.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/spacing.rules.d.ts +2 -0
- package/dist/design-system/ai/sdk/index.d.ts +1 -0
- package/dist/design-system/ai/sdk/runtime-sdk.d.ts +21 -0
- package/dist/design-system/ai/telemetry/usageMetrics.d.ts +9 -0
- package/dist/design-system/ai/validation/deterministicFeedback.d.ts +15 -0
- package/dist/design-system/ai/validation/driftDetection.d.ts +3 -0
- package/dist/design-system/ai/validation/index.d.ts +5 -0
- package/dist/design-system/ai/validation/schemaValidation.d.ts +7 -0
- package/dist/design-system/ai/validation/validateAIOutput.d.ts +25 -0
- package/dist/design-system/ai/validation/validateTree.d.ts +2 -0
- package/dist/design-system/components/Button/Button.d.ts +1 -1
- package/dist/design-system/components/Button/Button.types.d.ts +1 -0
- package/dist/design-system/components/Chip/Chip.d.ts +4 -3
- package/dist/design-system/components/Chip/Chip.types.d.ts +13 -9
- package/dist/design-system/components/Dialog/Dialog.types.d.ts +9 -8
- package/dist/design-system/components/Field/Field.d.ts +1 -1
- package/dist/design-system/components/Field/Field.types.d.ts +11 -9
- package/dist/design-system/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/design-system/components/FileUpload/FileUpload.types.d.ts +2 -0
- package/dist/design-system/components/Pagination/Pagination.d.ts +5 -3
- package/dist/design-system/components/Pagination/Pagination.types.d.ts +4 -1
- package/dist/design-system/components/ProgressCircle/ProgressCircle.d.ts +3 -2
- package/dist/design-system/components/ProgressCircle/ProgressCircle.types.d.ts +7 -3
- package/dist/design-system/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/design-system/components/ProgressIndicator/ProgressIndicator.types.d.ts +8 -4
- package/dist/design-system/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/design-system/components/Tooltip/Tooltip.types.d.ts +1 -0
- package/dist/design-system/generated/component-api.d.ts +1568 -0
- package/dist/design-system/index.d.ts +1 -2
- package/dist/design-system/tokens/runtime/color.d.ts +40 -0
- package/dist/design-system/tokens/runtime/generateCss.d.ts +2 -0
- package/dist/design-system/tokens/runtime/index.d.ts +476 -0
- package/dist/design-system/tokens/runtime/motion.d.ts +14 -0
- package/dist/design-system/tokens/runtime/radius.d.ts +14 -0
- package/dist/design-system/tokens/runtime/shadow.d.ts +22 -0
- package/dist/design-system/tokens/runtime/spacing.d.ts +21 -0
- package/dist/design-system/tokens/runtime/types.d.ts +21 -0
- package/dist/design-system/tokens/runtime/typography.d.ts +87 -0
- package/dist/design-system/version.d.ts +1 -0
- package/dist/generated/component-api.cjs +1 -0
- package/dist/generated/component-api.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/runtime/color.cjs +1 -0
- package/dist/tokens/runtime/color.js +1 -0
- package/dist/tokens/runtime/index.cjs +1 -0
- package/dist/tokens/runtime/index.js +1 -0
- package/dist/tokens/runtime/radius.cjs +1 -0
- package/dist/tokens/runtime/radius.js +1 -0
- package/dist/tokens/runtime/spacing.cjs +1 -0
- package/dist/tokens/runtime/spacing.js +1 -0
- package/dist/version.cjs +1 -0
- package/dist/version.js +1 -0
- package/package.json +74 -14
- package/dist/components/PillToggle/PillToggle.cjs +0 -1
- package/dist/components/PillToggle/PillToggle.js +0 -1
- package/dist/components/Playground/Playground.cjs +0 -9
- package/dist/components/Playground/Playground.js +0 -9
- package/dist/components/Text/Text.spec.cjs +0 -1
- package/dist/components/Text/Text.spec.js +0 -1
- package/dist/design-system/components/PillToggle/PillToggle.d.ts +0 -13
- package/dist/design-system/components/PillToggle/PillToggle.types.d.ts +0 -9
- package/dist/design-system/components/PillToggle/index.d.ts +0 -3
- package/dist/design-system/components/Playground/Playground.d.ts +0 -12
- package/dist/design-system/components/Playground/Playground.types.d.ts +0 -7
- package/dist/design-system/components/Playground/index.d.ts +0 -3
- package/dist/design-system/components/Text/Text.spec.d.ts +0 -2
- package/dist/design-system/specs/spec.types.d.ts +0 -18
package/dist/tokens/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { shadowTokens } from "./shadow.js";
|
|
|
7
7
|
export { motionTokens } from "./motion.js";
|
|
8
8
|
export { generateRuntimeTokensCss } from "./generateCss.js";
|
|
9
9
|
export type { CssVarMap, RuntimeTokens, TokenCategory, TypographyCategory } from "./types.js";
|
|
10
|
+
export declare const tokenVersion = "1.0.0";
|
|
10
11
|
export declare const runtimeTokens: RuntimeTokens;
|
|
11
12
|
export declare const tokensByCategory: {
|
|
12
13
|
readonly color: {
|
package/dist/tokens/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { typographyTokens } from "./typography.js";
|
|
|
11
11
|
export { shadowTokens } from "./shadow.js";
|
|
12
12
|
export { motionTokens } from "./motion.js";
|
|
13
13
|
export { generateRuntimeTokensCss } from "./generateCss.js";
|
|
14
|
+
export const tokenVersion = "1.0.0";
|
|
14
15
|
export const runtimeTokens = {
|
|
15
16
|
color: colorCategory,
|
|
16
17
|
spacing: spacingCategory,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=f=>({25:f[0],50:f[1],100:f[2],200:f[3],300:f[4],400:f[5],500:f[6],600:f[7],700:f[8],800:f[9],900:f[10],1e3:f[11]}),d=f=>({25:f[0],50:f[1],100:f[2],200:f[3],300:f[4],400:f[5],500:f[6],600:f[7],700:f[8],800:f[9],900:f[10]}),a={neutrals:e(["#fafbfc","#f9fafc","#f3f4f6","#e6e7eb","#d2d5dc","#9ca2ae","#6b7380","#4c5564","#384152","#202938","#111828","#0d1320"]),brand:{primary:d(["#f2fafd","#e3f5fa","#aee0f4","#78cbec","#41b7e5","#00a7e1","#009add","#008dcf","#0c6bb0","#006aa8","#004b88"]),secondary:d(["#fefbf5","#fef8ee","#feefd6","#fbdcad","#f9c278","#f59e42","#f2821f","#e36613","#bc4d12","#963e16","#793515"]),tertiary:d(["#eff2f5","#e6ebf0","#bfcddb","#97adc3","#708caa","#4f7499","#295d8b","#215583","#174b77","#12416b","#0f3152"]),quaternary:d(["#fefdf6","#fdfbed","#f8f3cb","#f1e796","#ead55f","#f8ca10","#fbb03a","#c3841c","#a26e1b","#845c1c","#6d4d1a"])},accent:{amber:e(["#fffbeb","#fef3c7","#fde68a","#fcd34d","#fbc02d","#fbbf24","#f59e0b","#d97706","#b45309","#92400e","#78350f","#5f2a09"]),aqua:e(["#f0fdfa","#ccfbf1","#99f6e4","#5eead4","#2dd4bf","#14b8a6","#0d9488","#0f766e","#115e59","#134e4a","#0f3a37","#0a2e2c"]),blue:e(["#f2f7ff","#eff6ff","#dbeaff","#bfdcfe","#93c4fc","#61a5fa","#3b82f6","#2563ec","#1d4ed7","#1f41af","#1f3a8b","#182e6f"]),cyan:e(["#effeff","#ecfeff","#cffbfe","#a5f3fd","#66e8f8","#21d3ed","#07b6d5","#0891b3","#0f7490","#165e76","#164f63","#113f4f"]),emerald:e(["#effdf7","#ecfdf5","#d0fae4","#a7f3cf","#6de7b6","#34d399","#10b982","#05976a","#057857","#075f47","#064d3b","#043d2f"]),fuchsia:e(["#fef6ff","#fef4ff","#fae8fe","#f5cffe","#f0abfc","#e879f9","#d946ef","#c026d4","#a21caf","#861990","#701a75","#59145d"]),green:e(["#f3fdf6","#f0fdf4","#dcfce7","#bbf7d1","#86efac","#4ade80","#23c55e","#17a34a","#157f3d","#176535","#15532e","#104224"]),indigo:e(["#f1f4fe","#eef2fe","#e1e7ff","#c7d2ff","#a6b4fd","#818cf8","#6366f1","#5046e5","#4438ca","#3730a2","#312d81","#272467"]),lime:e(["#f7feeb","#f6fee7","#ecfccb","#daf99c","#bef164","#a3e636","#83cc16","#64a30e","#5a8720","#3f6212","#365313","#2b420f"]),magenta:e(["#fff5fb","#fdf2f8","#fce7f3","#fbcfe8","#f9a8d4","#f472b6","#ec4899","#db2777","#be185d","#9d174d","#831843","#6b1235"]),orange:e(["#fffbf7","#fffaf5","#fff6ed","#ffead5","#fddcab","#feb273","#fd853a","#fb6514","#ec4a0a","#9c2a10","#7e2410","#641c0c"]),purple:e(["#fbf7ff","#fbf5ff","#f4e8fe","#ead5fe","#d8b4fe","#c085fd","#a755f7","#9334ea","#7e22cf","#6b22a8","#571c86","#45166b"]),red:e(["#fef4f4","#fef2f2","#fee2e1","#fecbca","#fda5a4","#f87070","#f04444","#dc2625","#ba1c1d","#991b1c","#7f1d1e","#651718"]),rose:e(["#fff3f3","#fff1f1","#fee4e7","#fecdd3","#fea4b0","#fb7286","#f43f5e","#e21d48","#be113c","#9f133a","#891336","#6d0f2b"]),sky:e(["#f3faff","#f0f9ff","#e0f2fe","#bae7fe","#7ed3fc","#38bdf8","#0ea5ea","#0384c6","#0469a1","#075a86","#0c4a6f","#0c4a6f"]),violet:e(["#f7f5ff","#f5f3ff","#edeaff","#ddd6ff","#c5b5fe","#a78bfa","#8b5cf6","#7d3aec","#6d28d9","#5b20b6","#4d1d95","#3d1777"]),yellow:e(["#fefcec","#fefce8","#fef9c3","#fef08a","#fde047","#facc15","#e9b308","#ca8a04","#a26208","#854e0e","#723f12","#5b320e"])}};for(const[f,c]of Object.entries(a.neutrals));for(const[f,c]of Object.entries(a.brand))for(const[b,o]of Object.entries(c));for(const[f,c]of Object.entries(a.accent))for(const[b,o]of Object.entries(c));exports.colorTokens=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=f=>({25:f[0],50:f[1],100:f[2],200:f[3],300:f[4],400:f[5],500:f[6],600:f[7],700:f[8],800:f[9],900:f[10],1e3:f[11]}),d=f=>({25:f[0],50:f[1],100:f[2],200:f[3],300:f[4],400:f[5],500:f[6],600:f[7],700:f[8],800:f[9],900:f[10]}),a={neutrals:e(["#fafbfc","#f9fafc","#f3f4f6","#e6e7eb","#d2d5dc","#9ca2ae","#6b7380","#4c5564","#384152","#202938","#111828","#0d1320"]),brand:{primary:d(["#f2fafd","#e3f5fa","#aee0f4","#78cbec","#41b7e5","#00a7e1","#009add","#008dcf","#0c6bb0","#006aa8","#004b88"]),secondary:d(["#fefbf5","#fef8ee","#feefd6","#fbdcad","#f9c278","#f59e42","#f2821f","#e36613","#bc4d12","#963e16","#793515"]),tertiary:d(["#eff2f5","#e6ebf0","#bfcddb","#97adc3","#708caa","#4f7499","#295d8b","#215583","#174b77","#12416b","#0f3152"]),quaternary:d(["#fefdf6","#fdfbed","#f8f3cb","#f1e796","#ead55f","#f8ca10","#fbb03a","#c3841c","#a26e1b","#845c1c","#6d4d1a"])},accent:{amber:e(["#fffbeb","#fef3c7","#fde68a","#fcd34d","#fbc02d","#fbbf24","#f59e0b","#d97706","#b45309","#92400e","#78350f","#5f2a09"]),aqua:e(["#f0fdfa","#ccfbf1","#99f6e4","#5eead4","#2dd4bf","#14b8a6","#0d9488","#0f766e","#115e59","#134e4a","#0f3a37","#0a2e2c"]),blue:e(["#f2f7ff","#eff6ff","#dbeaff","#bfdcfe","#93c4fc","#61a5fa","#3b82f6","#2563ec","#1d4ed7","#1f41af","#1f3a8b","#182e6f"]),cyan:e(["#effeff","#ecfeff","#cffbfe","#a5f3fd","#66e8f8","#21d3ed","#07b6d5","#0891b3","#0f7490","#165e76","#164f63","#113f4f"]),emerald:e(["#effdf7","#ecfdf5","#d0fae4","#a7f3cf","#6de7b6","#34d399","#10b982","#05976a","#057857","#075f47","#064d3b","#043d2f"]),fuchsia:e(["#fef6ff","#fef4ff","#fae8fe","#f5cffe","#f0abfc","#e879f9","#d946ef","#c026d4","#a21caf","#861990","#701a75","#59145d"]),green:e(["#f3fdf6","#f0fdf4","#dcfce7","#bbf7d1","#86efac","#4ade80","#23c55e","#17a34a","#157f3d","#176535","#15532e","#104224"]),indigo:e(["#f1f4fe","#eef2fe","#e1e7ff","#c7d2ff","#a6b4fd","#818cf8","#6366f1","#5046e5","#4438ca","#3730a2","#312d81","#272467"]),lime:e(["#f7feeb","#f6fee7","#ecfccb","#daf99c","#bef164","#a3e636","#83cc16","#64a30e","#5a8720","#3f6212","#365313","#2b420f"]),magenta:e(["#fff5fb","#fdf2f8","#fce7f3","#fbcfe8","#f9a8d4","#f472b6","#ec4899","#db2777","#be185d","#9d174d","#831843","#6b1235"]),orange:e(["#fffbf7","#fffaf5","#fff6ed","#ffead5","#fddcab","#feb273","#fd853a","#fb6514","#ec4a0a","#9c2a10","#7e2410","#641c0c"]),purple:e(["#fbf7ff","#fbf5ff","#f4e8fe","#ead5fe","#d8b4fe","#c085fd","#a755f7","#9334ea","#7e22cf","#6b22a8","#571c86","#45166b"]),red:e(["#fef4f4","#fef2f2","#fee2e1","#fecbca","#fda5a4","#f87070","#f04444","#dc2625","#ba1c1d","#991b1c","#7f1d1e","#651718"]),rose:e(["#fff3f3","#fff1f1","#fee4e7","#fecdd3","#fea4b0","#fb7286","#f43f5e","#e21d48","#be113c","#9f133a","#891336","#6d0f2b"]),sky:e(["#f3faff","#f0f9ff","#e0f2fe","#bae7fe","#7ed3fc","#38bdf8","#0ea5ea","#0384c6","#0469a1","#075a86","#0c4a6f","#0c4a6f"]),violet:e(["#f7f5ff","#f5f3ff","#edeaff","#ddd6ff","#c5b5fe","#a78bfa","#8b5cf6","#7d3aec","#6d28d9","#5b20b6","#4d1d95","#3d1777"]),yellow:e(["#fefcec","#fefce8","#fef9c3","#fef08a","#fde047","#facc15","#e9b308","#ca8a04","#a26208","#854e0e","#723f12","#5b320e"])}};for(const[f,c]of Object.entries(a.neutrals));for(const[f,c]of Object.entries(a.brand))for(const[b,o]of Object.entries(c));for(const[f,c]of Object.entries(a.accent))for(const[b,o]of Object.entries(c));export{a as colorTokens};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.0.0";exports.tokenVersion=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="1.0.0";export{o as tokenVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={0:"0px",2:"2px",4:"4px",6:"6px",8:"8px",12:"12px",16:"16px",20:"20px",24:"24px",9999:"9999px"};Object.fromEntries(Object.entries(e).map(([s,p])=>[`--uds-radius-${s}`,p]));exports.radiusTokens=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s={0:"0px",2:"2px",4:"4px",6:"6px",8:"8px",12:"12px",16:"16px",20:"20px",24:"24px",9999:"9999px"};Object.fromEntries(Object.entries(s).map(([p,x])=>[`--uds-radius-${p}`,x]));export{s as radiusTokens};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p={0:"0px",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",16:"16px",18:"18px",24:"24px",32:"32px",36:"36px",40:"40px",48:"48px",64:"64px",80:"80px"};Object.fromEntries(Object.entries(p).map(([x,e])=>[`--uds-spacing-${x}`,e]));exports.spacingTokens=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s={0:"0px",2:"2px",4:"4px",6:"6px",8:"8px",10:"10px",12:"12px",14:"14px",16:"16px",18:"18px",24:"24px",32:"32px",36:"36px",40:"40px",48:"48px",64:"64px",80:"80px"};Object.fromEntries(Object.entries(s).map(([p,x])=>[`--uds-spacing-${p}`,x]));export{s as spacingTokens};
|
package/dist/version.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.2.12";exports.UDS_RUNTIME_VERSION=e;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="0.2.12";export{o as UDS_RUNTIME_VERSION};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mich8060/unified-design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -26,6 +26,18 @@
|
|
|
26
26
|
"require": "./dist/index.cjs",
|
|
27
27
|
"default": "./dist/index.js"
|
|
28
28
|
},
|
|
29
|
+
"./ai": {
|
|
30
|
+
"types": "./dist/design-system/ai/index.d.ts",
|
|
31
|
+
"import": "./dist/ai/index.js",
|
|
32
|
+
"require": "./dist/ai/index.cjs",
|
|
33
|
+
"default": "./dist/ai/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./ai/schema": "./dist/ai/schemas/ai-output.schema.json",
|
|
36
|
+
"./ai/templates.json": "./dist/ai/templates/layouts.json",
|
|
37
|
+
"./ai/templates": "./dist/ai/templates/layouts.json",
|
|
38
|
+
"./ai/manifest.json": "./dist/ai/manifest.json",
|
|
39
|
+
"./ai/discovery.json": "./dist/ai/discovery.json",
|
|
40
|
+
"./ai/discovery": "./dist/ai/discovery.json",
|
|
29
41
|
"./Accordion": {
|
|
30
42
|
"types": "./dist/design-system/components/Accordion/Accordion.d.ts",
|
|
31
43
|
"import": "./dist/components/Accordion/Accordion.js",
|
|
@@ -212,18 +224,6 @@
|
|
|
212
224
|
"require": "./dist/components/Pagination/Pagination.cjs",
|
|
213
225
|
"default": "./dist/components/Pagination/Pagination.js"
|
|
214
226
|
},
|
|
215
|
-
"./PillToggle": {
|
|
216
|
-
"types": "./dist/design-system/components/PillToggle/PillToggle.d.ts",
|
|
217
|
-
"import": "./dist/components/PillToggle/PillToggle.js",
|
|
218
|
-
"require": "./dist/components/PillToggle/PillToggle.cjs",
|
|
219
|
-
"default": "./dist/components/PillToggle/PillToggle.js"
|
|
220
|
-
},
|
|
221
|
-
"./Playground": {
|
|
222
|
-
"types": "./dist/design-system/components/Playground/Playground.d.ts",
|
|
223
|
-
"import": "./dist/components/Playground/Playground.js",
|
|
224
|
-
"require": "./dist/components/Playground/Playground.cjs",
|
|
225
|
-
"default": "./dist/components/Playground/Playground.js"
|
|
226
|
-
},
|
|
227
227
|
"./ProgressCircle": {
|
|
228
228
|
"types": "./dist/design-system/components/ProgressCircle/ProgressCircle.d.ts",
|
|
229
229
|
"import": "./dist/components/ProgressCircle/ProgressCircle.js",
|
|
@@ -314,6 +314,54 @@
|
|
|
314
314
|
"require": "./dist/components/Tooltip/Tooltip.cjs",
|
|
315
315
|
"default": "./dist/components/Tooltip/Tooltip.js"
|
|
316
316
|
},
|
|
317
|
+
"./ai/manifest": {
|
|
318
|
+
"types": "./dist/design-system/ai/manifest/index.d.ts",
|
|
319
|
+
"import": "./dist/ai/manifest/index.js",
|
|
320
|
+
"require": "./dist/ai/manifest/index.cjs",
|
|
321
|
+
"default": "./dist/ai/manifest/index.js"
|
|
322
|
+
},
|
|
323
|
+
"./ai/validate": {
|
|
324
|
+
"types": "./dist/design-system/ai/validation/validateAIOutput.d.ts",
|
|
325
|
+
"import": "./dist/ai/validation/validateAIOutput.js",
|
|
326
|
+
"require": "./dist/ai/validation/validateAIOutput.cjs",
|
|
327
|
+
"default": "./dist/ai/validation/validateAIOutput.js"
|
|
328
|
+
},
|
|
329
|
+
"./ai/policy": {
|
|
330
|
+
"types": "./dist/design-system/ai/policies/policy.engine.d.ts",
|
|
331
|
+
"import": "./dist/ai/policies/policy.engine.js",
|
|
332
|
+
"require": "./dist/ai/policies/policy.engine.cjs",
|
|
333
|
+
"default": "./dist/ai/policies/policy.engine.js"
|
|
334
|
+
},
|
|
335
|
+
"./ai/audit": {
|
|
336
|
+
"types": "./dist/design-system/ai/audit/auditLogger.d.ts",
|
|
337
|
+
"import": "./dist/ai/audit/auditLogger.js",
|
|
338
|
+
"require": "./dist/ai/audit/auditLogger.cjs",
|
|
339
|
+
"default": "./dist/ai/audit/auditLogger.js"
|
|
340
|
+
},
|
|
341
|
+
"./ai/validation": {
|
|
342
|
+
"types": "./dist/design-system/ai/validation/index.d.ts",
|
|
343
|
+
"import": "./dist/ai/validation/index.js",
|
|
344
|
+
"require": "./dist/ai/validation/index.cjs",
|
|
345
|
+
"default": "./dist/ai/validation/index.js"
|
|
346
|
+
},
|
|
347
|
+
"./ai/sdk": {
|
|
348
|
+
"types": "./dist/design-system/ai/sdk/index.d.ts",
|
|
349
|
+
"import": "./dist/ai/sdk/index.js",
|
|
350
|
+
"require": "./dist/ai/sdk/index.cjs",
|
|
351
|
+
"default": "./dist/ai/sdk/index.js"
|
|
352
|
+
},
|
|
353
|
+
"./ai/examples": {
|
|
354
|
+
"types": "./dist/design-system/ai/examples/index.d.ts",
|
|
355
|
+
"import": "./dist/ai/examples/index.js",
|
|
356
|
+
"require": "./dist/ai/examples/index.cjs",
|
|
357
|
+
"default": "./dist/ai/examples/index.js"
|
|
358
|
+
},
|
|
359
|
+
"./ai/*": {
|
|
360
|
+
"types": "./dist/design-system/ai/*.d.ts",
|
|
361
|
+
"import": "./dist/ai/*.js",
|
|
362
|
+
"require": "./dist/ai/*.cjs",
|
|
363
|
+
"default": "./dist/ai/*.js"
|
|
364
|
+
},
|
|
317
365
|
"./styles.css": "./dist/style.css",
|
|
318
366
|
"./tokens": {
|
|
319
367
|
"types": "./dist/tokens/index.d.ts",
|
|
@@ -353,9 +401,21 @@
|
|
|
353
401
|
"sideEffects": false,
|
|
354
402
|
"scripts": {
|
|
355
403
|
"dev": "vite --configLoader native",
|
|
356
|
-
"build": "vite build --configLoader native && npm run build:types && npm run build:tokens",
|
|
404
|
+
"build": "vite build --configLoader native && npm run build:types && npm run build:tokens && npm run build:ai:schema && npm run build:ai:templates && npm run build:api && npm run build:ai:manifest && npm run build:ai:discovery",
|
|
357
405
|
"build:types": "tsc -p tsconfig.build.json",
|
|
358
406
|
"build:tokens": "tsc -p tsconfig.tokens.json && node --experimental-specifier-resolution=node scripts/generate-tokens-css.mjs",
|
|
407
|
+
"build:ai:schema": "node scripts/copy-ai-schema.mjs",
|
|
408
|
+
"build:ai:templates": "node scripts/copy-ai-templates.mjs",
|
|
409
|
+
"build:api": "node --experimental-strip-types scripts/generate-api-artifacts.ts",
|
|
410
|
+
"build:ai:manifest": "node --experimental-strip-types --experimental-specifier-resolution=node scripts/generate-ai-manifest.ts",
|
|
411
|
+
"build:ai:discovery": "node --experimental-strip-types --experimental-specifier-resolution=node scripts/generate-ai-discovery.ts",
|
|
412
|
+
"ai:validate": "node scripts/validate-ai-output.mjs",
|
|
413
|
+
"ai:validate:examples": "node --experimental-strip-types --experimental-specifier-resolution=node scripts/validate-ai-training-examples.ts",
|
|
414
|
+
"ai:gate:contracts": "node scripts/check-ai-contract-integrity.mjs",
|
|
415
|
+
"ai:enforce": "node scripts/enforce-ai-usage.mjs",
|
|
416
|
+
"ai:token-diff": "node scripts/diff-token-usage.mjs",
|
|
417
|
+
"ai:generate-ui": "node --experimental-strip-types scripts/ai/generate-ui.ts",
|
|
418
|
+
"ci:ai": "npm run ai:validate && npm run ai:validate:examples && npm run ai:gate:contracts && npm run ai:enforce && npm run ai:token-diff",
|
|
359
419
|
"size:check": "node scripts/check-bundle-size.mjs",
|
|
360
420
|
"ci:bundle": "npm run build && npm run size:check",
|
|
361
421
|
"preview": "vite preview --configLoader native",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */const e="uds-pill-toggle";function h({label:o="Label States",selected:s=!1,onChange:a,id:c,disabled:l=!1,className:i="",...r}){const n=c||`pill-toggle-${Math.random().toString(36).substr(2,9)}`,u=d=>{!l&&a&&a(d.target.checked)},g=[e,s&&`${e}--selected`,l&&`${e}--disabled`,i].filter(Boolean).join(" ");return t.jsxs("label",{className:g,htmlFor:n,...r,children:[t.jsx("input",{type:"checkbox",id:n,className:`${e}__input`,checked:s,onChange:u,disabled:l}),t.jsx("span",{className:`${e}__label`,children:o})]})}exports.default=h;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as p,jsx as o}from"react/jsx-runtime";/* empty css */const e="uds-pill-toggle";function u({label:n="Label States",selected:t=!1,onChange:s,id:c,disabled:l=!1,className:i="",...r}){const a=c||`pill-toggle-${Math.random().toString(36).substr(2,9)}`,g=m=>{!l&&s&&s(m.target.checked)},h=[e,t&&`${e}--selected`,l&&`${e}--disabled`,i].filter(Boolean).join(" ");return p("label",{className:h,htmlFor:a,...r,children:[o("input",{type:"checkbox",id:a,className:`${e}__input`,checked:t,onChange:g,disabled:l}),o("span",{className:`${e}__label`,children:n})]})}export{u as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("react"),h=require("../Icon/Icon.cjs"),N=require("../Button/Button.cjs"),z=require("../ActionMenu/ActionMenu.cjs");;/* empty css */const J=["Placeholder","ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Check","Close","X","Plus","Minus","Edit","Pencil","Trash","Search","MagnifyingGlass","Settings","Gear","User","Users","Home","House","Star","Heart","Bookmark","Share","Download","Upload","Copy","CopySimple","Code","GearSix","List","SquaresFour","DiamondsFour","CirclesThree","CaretDown","CaretUp","CaretLeft","CaretRight","Info","Warning","CheckCircle","XCircle","Bell","Notification","Mail","Phone","Calendar","Clock","Image","File","Folder","Lock","Unlock","Eye","EyeSlash","Filter","Sort","Grid","Menu","More","DotsThree"];function V({component:t,propDefinitions:u={},title:X="Playground",initialProps:I={},renderComponent:v}){const[m,C]=g.useState("inspector"),S=()=>{const a={...I};return Object.keys(u).forEach(l=>{if(a[l]===void 0){const o=l.toLowerCase().includes("icon")||u[l].type==="icon",s=u[l].default;o&&(s===void 0||s==="")?a[l]="Placeholder":s!==void 0&&(a[l]=s)}}),a},[i,$]=g.useState(S),_=g.useCallback((a,l)=>{$(o=>({...o,[a]:l}))},[]);g.useCallback(()=>{$(S())},[]);const A=g.useCallback(()=>{const a=(t==null?void 0:t.name)||"Component",l=Object.entries(i).filter(([s,r])=>r!=null&&r!==""&&r!=="Placeholder").map(([s,r])=>typeof r=="string"?`${s}="${r}"`:typeof r=="boolean"?r?s:`${s}={false}`:`${s}={${JSON.stringify(r)}}`).join(" "),o=`<${a}${l?" "+l:""} />`;navigator.clipboard.writeText(o)},[i,t]),w=(a,l)=>{const{type:o,label:s,options:r,min:T,max:U,step:G,placeholder:D}=l,j=a.toLowerCase().includes("icon")||o==="icon",y=l.default,E=j&&(y===void 0||y==="")?"Placeholder":y??"",c=i[a]??E,M=j&&!r?J.map(d=>({value:d,label:d})):r;switch(o){case"icon":case"select":const d=M||r||[],b=d.find(n=>n.value===c)||d[0],H=b?b.label||b.value:c||"Select...",R=d.map(n=>({id:n.value,label:n.label||n.value,onClick:()=>_(a,n.value)}));return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx(z.default,{trigger:e.jsxs("button",{type:"button",className:"playground__select-trigger","aria-label":s||a,children:[e.jsx("span",{className:"playground__select-value",children:H}),e.jsx(h.default,{name:"CaretDown",size:16,appearance:"regular"})]}),items:R,placement:"bottom-start"})})]},a);case"boolean":return e.jsxs("div",{className:"playground__state-item",children:[e.jsx("label",{className:"playground__state-label",children:s||a}),e.jsx("input",{type:"checkbox",className:"playground__checkbox",checked:c,onChange:n=>_(a,n.target.checked)})]},a);case"number":return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx("input",{id:`playground-${a}`,type:"number",className:"playground__input",value:c,min:T,max:U,step:G,onChange:n=>_(a,Number(n.target.value))})})]},a);case"text":case"string":default:if(j){const n=M||[],f=n.find(p=>p.value===c)||n[0],Z=f?f.label||f.value:c||"Placeholder",B=n.map(p=>({id:p.value,label:p.label||p.value,onClick:()=>_(a,p.value)}));return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx(z.default,{trigger:e.jsxs("button",{type:"button",className:"playground__select-trigger","aria-label":s||a,children:[e.jsx("span",{className:"playground__select-value",children:Z}),e.jsx(h.default,{name:"CaretDown",size:16,appearance:"regular"})]}),items:B,placement:"bottom-start"})})]},a)}return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx("input",{id:`playground-${a}`,type:"text",className:"playground__input",value:c,placeholder:D,onChange:n=>_(a,n.target.value)})})]},a)}},P=Object.entries(u).filter(([a,l])=>l.type!=="boolean"),O=Object.entries(u).filter(([a,l])=>l.type==="boolean"),x=(t==null?void 0:t.name)||"Component",F=Object.entries(i).filter(([a,l])=>l!=null&&l!==""&&l!=="Placeholder").map(([a,l])=>typeof l=="string"?` ${a}="${l}"`:typeof l=="boolean"?l?` ${a}`:` ${a}={false}`:` ${a}={${JSON.stringify(l)}}`).join(`
|
|
2
|
-
`),q=`import { ${x} } from '@/components/${x}';
|
|
3
|
-
|
|
4
|
-
export function Example() {
|
|
5
|
-
return (
|
|
6
|
-
<${x}${F?`
|
|
7
|
-
`+F+`
|
|
8
|
-
`:" "}/> );
|
|
9
|
-
}`,L=a=>{let l=a;return l=l.replace(/\b(import|export|function|return|from)\b/g,'<span style="color: #c085fd;">$1</span>'),l=l.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g,'<span style="color: #4ade80;">$1$2$1</span>'),l=l.replace(/<(\/?)([A-Z][a-zA-Z0-9]*)/g,'<span style="color: #f87070;"><$1$2</span>'),l=l.replace(/\b([A-Z][a-zA-Z0-9]*)\b(?=\s*[={])/g,'<span style="color: #61a5fa;">$1</span>'),l=l.replace(/(\w+)=/g,'<span style="color: #ca8a04;">$1</span>='),l};return e.jsx("div",{className:"playground",children:e.jsxs("div",{className:"playground__container",children:[e.jsxs("div",{className:"playground__canvas",children:[e.jsx("div",{className:"playground__canvas-content",children:v?v(i):e.jsx(t,{...i})}),e.jsxs("div",{className:"playground__actions",children:[e.jsx(N.default,{appearance:m==="code"?"primary":"text",layout:"icon-only",size:"small",icon:"Code","aria-label":"Show code",onClick:()=>C("code")}),e.jsx("div",{className:"playground__actions-divider"}),e.jsx(N.default,{appearance:m==="inspector"?"primary":"text",layout:"icon-only",size:"small",icon:"GearSix","aria-label":"Show inspector",onClick:()=>C("inspector")})]})]}),e.jsx("div",{className:"playground__panel",children:m==="inspector"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"playground__panel-header",children:e.jsxs("div",{className:"playground__panel-header-content",children:[e.jsxs("div",{className:"playground__panel-title-row",children:[e.jsx(h.default,{name:"GearSix",size:16,appearance:"bold"}),e.jsx("h3",{className:"playground__panel-title",children:"Inspector"})]}),e.jsx("p",{className:"playground__panel-subtitle",children:"Customize component properties"})]})}),e.jsxs("div",{className:"playground__panel-content",children:[P.length>0&&e.jsxs("div",{className:"playground__section",children:[e.jsxs("div",{className:"playground__section-title",children:[e.jsx(h.default,{name:"SquaresFour",size:16,appearance:"bold"}),e.jsx("span",{children:"Properties"})]}),e.jsx("div",{className:"playground__section-content",children:P.map(([a,l])=>w(a,l))})]}),O.length>0&&e.jsxs("div",{className:"playground__section",children:[e.jsxs("div",{className:"playground__section-title",children:[e.jsx(h.default,{name:"SquaresFour",size:16,appearance:"bold"}),e.jsx("span",{children:"States"})]}),e.jsx("div",{className:"playground__section-content",children:e.jsx("div",{className:"playground__states-list",children:O.map(([a,l])=>w(a,l))})})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"playground__panel-header",children:[e.jsxs("div",{className:"playground__panel-header-content",children:[e.jsx("div",{className:"playground__panel-title-row",children:e.jsx("h3",{className:"playground__panel-title",children:"Component Code"})}),e.jsx("p",{className:"playground__panel-subtitle",children:"Copy and paste into your project"})]}),e.jsx(N.default,{appearance:"outline",layout:"icon-left",size:"small",icon:"CopySimple",label:"Copy",onClick:A})]}),e.jsx("div",{className:"playground__code-container",children:e.jsx("div",{className:"playground__code-block",children:e.jsx("pre",{className:"playground__code-pre",children:e.jsx("code",{className:"playground__code",dangerouslySetInnerHTML:{__html:L(q)}})})})}),e.jsxs("div",{className:"playground__pro-tips",children:[e.jsx("p",{className:"playground__pro-tips-title",children:"Pro Tips:"}),e.jsxs("ul",{className:"playground__pro-tips-list",children:[e.jsx("li",{children:"Customize props in the inspector to update the code"}),e.jsx("li",{children:"All components are fully typed with TypeScript"}),e.jsx("li",{children:"Use Cmd/Ctrl + K to toggle the panel"})]})]})]})})]})})}exports.default=V;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as j}from"react/jsx-runtime";import{useState as A,useCallback as C}from"react";import h from"../Icon/Icon.js";import $ from"../Button/Button.js";import L from"../ActionMenu/ActionMenu.js";/* empty css */const K=["Placeholder","ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Check","Close","X","Plus","Minus","Edit","Pencil","Trash","Search","MagnifyingGlass","Settings","Gear","User","Users","Home","House","Star","Heart","Bookmark","Share","Download","Upload","Copy","CopySimple","Code","GearSix","List","SquaresFour","DiamondsFour","CirclesThree","CaretDown","CaretUp","CaretLeft","CaretRight","Info","Warning","CheckCircle","XCircle","Bell","Notification","Mail","Phone","Calendar","Clock","Image","File","Folder","Lock","Unlock","Eye","EyeSlash","Filter","Sort","Grid","Menu","More","DotsThree"];function ne({component:s,propDefinitions:m={},title:W="Playground",initialProps:T={},renderComponent:S}){const[g,w]=A("inspector"),x=()=>{const a={...T};return Object.keys(m).forEach(l=>{if(a[l]===void 0){const c=l.toLowerCase().includes("icon")||m[l].type==="icon",r=m[l].default;c&&(r===void 0||r==="")?a[l]="Placeholder":r!==void 0&&(a[l]=r)}}),a},[d,P]=A(x),_=C((a,l)=>{P(c=>({...c,[a]:l}))},[]);C(()=>{P(x())},[]);const U=C(()=>{const a=(s==null?void 0:s.name)||"Component",l=Object.entries(d).filter(([r,t])=>t!=null&&t!==""&&t!=="Placeholder").map(([r,t])=>typeof t=="string"?`${r}="${t}"`:typeof t=="boolean"?t?r:`${r}={false}`:`${r}={${JSON.stringify(t)}}`).join(" "),c=`<${a}${l?" "+l:""} />`;navigator.clipboard.writeText(c)},[d,s]),O=(a,l)=>{const{type:c,label:r,options:t,min:E,max:H,step:Z,placeholder:q}=l,N=a.toLowerCase().includes("icon")||c==="icon",b=l.default,B=N&&(b===void 0||b==="")?"Placeholder":b??"",i=d[a]??B,M=N&&!t?K.map(p=>({value:p,label:p})):t;switch(c){case"icon":case"select":const p=M||t||[],f=p.find(o=>o.value===i)||p[0],J=f?f.label||f.value:i||"Select...",R=p.map(o=>({id:o.value,label:o.label||o.value,onClick:()=>_(a,o.value)}));return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e(L,{trigger:n("button",{type:"button",className:"playground__select-trigger","aria-label":r||a,children:[e("span",{className:"playground__select-value",children:J}),e(h,{name:"CaretDown",size:16,appearance:"regular"})]}),items:R,placement:"bottom-start"})})]},a);case"boolean":return n("div",{className:"playground__state-item",children:[e("label",{className:"playground__state-label",children:r||a}),e("input",{type:"checkbox",className:"playground__checkbox",checked:i,onChange:o=>_(a,o.target.checked)})]},a);case"number":return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e("input",{id:`playground-${a}`,type:"number",className:"playground__input",value:i,min:E,max:H,step:Z,onChange:o=>_(a,Number(o.target.value))})})]},a);case"text":case"string":default:if(N){const o=M||[],v=o.find(u=>u.value===i)||o[0],V=v?v.label||v.value:i||"Placeholder",X=o.map(u=>({id:u.value,label:u.label||u.value,onClick:()=>_(a,u.value)}));return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e(L,{trigger:n("button",{type:"button",className:"playground__select-trigger","aria-label":r||a,children:[e("span",{className:"playground__select-value",children:V}),e(h,{name:"CaretDown",size:16,appearance:"regular"})]}),items:X,placement:"bottom-start"})})]},a)}return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e("input",{id:`playground-${a}`,type:"text",className:"playground__input",value:i,placeholder:q,onChange:o=>_(a,o.target.value)})})]},a)}},z=Object.entries(m).filter(([a,l])=>l.type!=="boolean"),F=Object.entries(m).filter(([a,l])=>l.type==="boolean"),y=(s==null?void 0:s.name)||"Component",I=Object.entries(d).filter(([a,l])=>l!=null&&l!==""&&l!=="Placeholder").map(([a,l])=>typeof l=="string"?` ${a}="${l}"`:typeof l=="boolean"?l?` ${a}`:` ${a}={false}`:` ${a}={${JSON.stringify(l)}}`).join(`
|
|
2
|
-
`),G=`import { ${y} } from '@/components/${y}';
|
|
3
|
-
|
|
4
|
-
export function Example() {
|
|
5
|
-
return (
|
|
6
|
-
<${y}${I?`
|
|
7
|
-
`+I+`
|
|
8
|
-
`:" "}/> );
|
|
9
|
-
}`,D=a=>{let l=a;return l=l.replace(/\b(import|export|function|return|from)\b/g,'<span style="color: #c085fd;">$1</span>'),l=l.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g,'<span style="color: #4ade80;">$1$2$1</span>'),l=l.replace(/<(\/?)([A-Z][a-zA-Z0-9]*)/g,'<span style="color: #f87070;"><$1$2</span>'),l=l.replace(/\b([A-Z][a-zA-Z0-9]*)\b(?=\s*[={])/g,'<span style="color: #61a5fa;">$1</span>'),l=l.replace(/(\w+)=/g,'<span style="color: #ca8a04;">$1</span>='),l};return e("div",{className:"playground",children:n("div",{className:"playground__container",children:[n("div",{className:"playground__canvas",children:[e("div",{className:"playground__canvas-content",children:S?S(d):e(s,{...d})}),n("div",{className:"playground__actions",children:[e($,{appearance:g==="code"?"primary":"text",layout:"icon-only",size:"small",icon:"Code","aria-label":"Show code",onClick:()=>w("code")}),e("div",{className:"playground__actions-divider"}),e($,{appearance:g==="inspector"?"primary":"text",layout:"icon-only",size:"small",icon:"GearSix","aria-label":"Show inspector",onClick:()=>w("inspector")})]})]}),e("div",{className:"playground__panel",children:g==="inspector"?n(j,{children:[e("div",{className:"playground__panel-header",children:n("div",{className:"playground__panel-header-content",children:[n("div",{className:"playground__panel-title-row",children:[e(h,{name:"GearSix",size:16,appearance:"bold"}),e("h3",{className:"playground__panel-title",children:"Inspector"})]}),e("p",{className:"playground__panel-subtitle",children:"Customize component properties"})]})}),n("div",{className:"playground__panel-content",children:[z.length>0&&n("div",{className:"playground__section",children:[n("div",{className:"playground__section-title",children:[e(h,{name:"SquaresFour",size:16,appearance:"bold"}),e("span",{children:"Properties"})]}),e("div",{className:"playground__section-content",children:z.map(([a,l])=>O(a,l))})]}),F.length>0&&n("div",{className:"playground__section",children:[n("div",{className:"playground__section-title",children:[e(h,{name:"SquaresFour",size:16,appearance:"bold"}),e("span",{children:"States"})]}),e("div",{className:"playground__section-content",children:e("div",{className:"playground__states-list",children:F.map(([a,l])=>O(a,l))})})]})]})]}):n(j,{children:[n("div",{className:"playground__panel-header",children:[n("div",{className:"playground__panel-header-content",children:[e("div",{className:"playground__panel-title-row",children:e("h3",{className:"playground__panel-title",children:"Component Code"})}),e("p",{className:"playground__panel-subtitle",children:"Copy and paste into your project"})]}),e($,{appearance:"outline",layout:"icon-left",size:"small",icon:"CopySimple",label:"Copy",onClick:U})]}),e("div",{className:"playground__code-container",children:e("div",{className:"playground__code-block",children:e("pre",{className:"playground__code-pre",children:e("code",{className:"playground__code",dangerouslySetInnerHTML:{__html:D(G)}})})})}),n("div",{className:"playground__pro-tips",children:[e("p",{className:"playground__pro-tips-title",children:"Pro Tips:"}),n("ul",{className:"playground__pro-tips-list",children:[e("li",{children:"Customize props in the inspector to update the code"}),e("li",{children:"All components are fully typed with TypeScript"}),e("li",{children:"Use Cmd/Ctrl + K to toggle the panel"})]})]})]})})]})})}export{ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={variants:{weight:{default:"regular"},leading:{default:"regular"}}};exports.TextSpec=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={variants:{weight:{default:"regular"},leading:{default:"regular"}}};export{e as TextSpec};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "./_pill-toggle.scss";
|
|
2
|
-
import type { PillToggleProps } from "./PillToggle.types";
|
|
3
|
-
/**
|
|
4
|
-
* PillToggle component for switching between selected and unselected states
|
|
5
|
-
* @param {string} label - The text content of the toggle
|
|
6
|
-
* @param {boolean} selected - Whether the toggle is selected
|
|
7
|
-
* @param {function} onChange - Callback function when toggle state changes
|
|
8
|
-
* @param {string} id - Unique identifier for the toggle input
|
|
9
|
-
* @param {boolean} disabled - Whether the toggle is disabled
|
|
10
|
-
* @param {string} className - Additional CSS classes
|
|
11
|
-
* @param {object} props - Additional props to pass to the toggle
|
|
12
|
-
*/
|
|
13
|
-
export default function PillToggle({ label, selected, onChange, id, disabled, className, ...props }: PillToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from "react";
|
|
2
|
-
export interface PillToggleProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
label?: string;
|
|
4
|
-
selected?: boolean;
|
|
5
|
-
onChange?: (...args: unknown[]) => void;
|
|
6
|
-
id?: unknown;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "./_playground.scss";
|
|
2
|
-
import type { PlaygroundProps } from "./Playground.types";
|
|
3
|
-
/**
|
|
4
|
-
* Playground component for interactive component prop manipulation
|
|
5
|
-
* Matches Figma design with Canvas + Inspector/Code Panel layout
|
|
6
|
-
* @param {React.Component} component - The component to render
|
|
7
|
-
* @param {object} propDefinitions - Object defining props and their controls
|
|
8
|
-
* @param {string} title - Optional title for the playground
|
|
9
|
-
* @param {object} initialProps - Initial prop values
|
|
10
|
-
* @param {function} renderComponent - Optional custom render function
|
|
11
|
-
*/
|
|
12
|
-
export default function Playground({ component: Component, propDefinitions, title, initialProps, renderComponent, }: PlaygroundProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes } from "react";
|
|
2
|
-
export interface PlaygroundProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
propDefinitions?: Record<string, unknown>;
|
|
4
|
-
title?: string;
|
|
5
|
-
initialProps?: Record<string, unknown>;
|
|
6
|
-
renderComponent?: unknown;
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type ComponentTier = 1 | 2 | 3 | 4;
|
|
2
|
-
export interface ComponentSpec {
|
|
3
|
-
name: string;
|
|
4
|
-
tier: ComponentTier;
|
|
5
|
-
purpose: string;
|
|
6
|
-
variants: Record<string, {
|
|
7
|
-
type: "enum" | "boolean";
|
|
8
|
-
values?: string[];
|
|
9
|
-
default: string | boolean;
|
|
10
|
-
}>;
|
|
11
|
-
states: string[];
|
|
12
|
-
tokensUsed: string[];
|
|
13
|
-
accessibility: {
|
|
14
|
-
role: string;
|
|
15
|
-
keyboard: string[];
|
|
16
|
-
};
|
|
17
|
-
antiPatterns?: string[];
|
|
18
|
-
}
|