@discourser/design-system 0.2.2 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discourser/design-system",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Aesthetic-agnostic design system with Panda CSS and Ark UI",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -63,6 +63,10 @@
63
63
  "tokens:generate": "tsx scripts/generate-palette.ts",
64
64
  "tokens:sync": "tsx scripts/sync-tokens.ts",
65
65
  "tokens:full": "pnpm tokens:generate && pnpm build:panda",
66
+ "organize-tokens": "tsx scripts/organize-figma-exports.ts",
67
+ "clean:old-backups": "bash scripts/clean-old-backups.sh",
68
+ "transform:dtcg-to-contract": "tsx scripts/dtcg-to-design-language.ts",
69
+ "transform:contract-to-dtcg": "tsx scripts/design-language-to-dtcg.ts",
66
70
  "docs:generate": "tsx scripts/generate-storybook-docs.ts",
67
71
  "typecheck": "tsc --noEmit",
68
72
  "changeset": "changeset",
@@ -92,6 +96,7 @@
92
96
  "@testing-library/jest-dom": "^6.9.1",
93
97
  "@testing-library/react": "^16.3.1",
94
98
  "@testing-library/user-event": "^14.6.1",
99
+ "@types/inquirer": "^9.0.9",
95
100
  "@types/node": "^22.0.0",
96
101
  "@types/react": "^19.0.0",
97
102
  "@types/react-dom": "^19.0.0",
@@ -104,6 +109,7 @@
104
109
  "eslint-plugin-react": "^7.35.0",
105
110
  "eslint-plugin-react-hooks": "^5.0.0",
106
111
  "husky": "^9.1.7",
112
+ "inquirer": "^13.1.0",
107
113
  "jest-axe": "^10.0.0",
108
114
  "jsdom": "^27.4.0",
109
115
  "lint-staged": "^16.2.7",
@@ -0,0 +1,34 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface HeadingVariant {
6
+ /**
7
+ * @default "xl"
8
+ */
9
+ size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl"
10
+ }
11
+
12
+ type HeadingVariantMap = {
13
+ [key in keyof HeadingVariant]: Array<HeadingVariant[key]>
14
+ }
15
+
16
+
17
+
18
+ export type HeadingVariantProps = {
19
+ [key in keyof HeadingVariant]?: ConditionalValue<HeadingVariant[key]> | undefined
20
+ }
21
+
22
+ export interface HeadingRecipe {
23
+
24
+ __type: HeadingVariantProps
25
+ (props?: HeadingVariantProps): string
26
+ raw: (props?: HeadingVariantProps) => HeadingVariantProps
27
+ variantMap: HeadingVariantMap
28
+ variantKeys: Array<keyof HeadingVariant>
29
+ splitVariantProps<Props extends HeadingVariantProps>(props: Props): [HeadingVariantProps, Pretty<DistributiveOmit<Props, keyof HeadingVariantProps>>]
30
+ getVariantProps: (props?: HeadingVariantProps) => HeadingVariantProps
31
+ }
32
+
33
+
34
+ export declare const heading: HeadingRecipe
@@ -0,0 +1,40 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const headingFn = /* @__PURE__ */ createRecipe('heading', {
5
+ "size": "xl"
6
+ }, [])
7
+
8
+ const headingVariantMap = {
9
+ "size": [
10
+ "xs",
11
+ "sm",
12
+ "md",
13
+ "lg",
14
+ "xl",
15
+ "2xl",
16
+ "3xl",
17
+ "4xl",
18
+ "5xl",
19
+ "6xl",
20
+ "7xl"
21
+ ]
22
+ }
23
+
24
+ const headingVariantKeys = Object.keys(headingVariantMap)
25
+
26
+ export const heading = /* @__PURE__ */ Object.assign(memo(headingFn.recipeFn), {
27
+ __recipe__: true,
28
+ __name__: 'heading',
29
+ __getCompoundVariantCss__: headingFn.__getCompoundVariantCss__,
30
+ raw: (props) => props,
31
+ variantKeys: headingVariantKeys,
32
+ variantMap: headingVariantMap,
33
+ merge(recipe) {
34
+ return mergeRecipes(this, recipe)
35
+ },
36
+ splitVariantProps(props) {
37
+ return splitProps(props, headingVariantKeys)
38
+ },
39
+ getVariantProps: headingFn.getVariantProps,
40
+ })
@@ -1,13 +1,16 @@
1
1
  /* eslint-disable */
2
2
  export * from './button';
3
3
  export * from './input';
4
+ export * from './input-addon';
4
5
  export * from './group';
5
6
  export * from './spinner';
6
7
  export * from './absolute-center';
8
+ export * from './heading';
7
9
  export * from './badge';
8
10
  export * from './skeleton';
9
11
  export * from './textarea';
10
12
  export * from './field';
13
+ export * from './input-group';
11
14
  export * from './card';
12
15
  export * from './accordion';
13
16
  export * from './drawer';
@@ -1,12 +1,15 @@
1
1
  export * from './button.mjs';
2
2
  export * from './input.mjs';
3
+ export * from './input-addon.mjs';
3
4
  export * from './group.mjs';
4
5
  export * from './spinner.mjs';
5
6
  export * from './absolute-center.mjs';
7
+ export * from './heading.mjs';
6
8
  export * from './badge.mjs';
7
9
  export * from './skeleton.mjs';
8
10
  export * from './textarea.mjs';
9
11
  export * from './field.mjs';
12
+ export * from './input-group.mjs';
10
13
  export * from './card.mjs';
11
14
  export * from './accordion.mjs';
12
15
  export * from './drawer.mjs';
@@ -0,0 +1,38 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface InputAddonVariant {
6
+ /**
7
+ * @default "outline"
8
+ */
9
+ variant: "outline" | "surface" | "subtle"
10
+ /**
11
+ * @default "md"
12
+ */
13
+ size: "xs" | "sm" | "md" | "lg" | "xl"
14
+ }
15
+
16
+ type InputAddonVariantMap = {
17
+ [key in keyof InputAddonVariant]: Array<InputAddonVariant[key]>
18
+ }
19
+
20
+
21
+
22
+ export type InputAddonVariantProps = {
23
+ [key in keyof InputAddonVariant]?: ConditionalValue<InputAddonVariant[key]> | undefined
24
+ }
25
+
26
+ export interface InputAddonRecipe {
27
+
28
+ __type: InputAddonVariantProps
29
+ (props?: InputAddonVariantProps): string
30
+ raw: (props?: InputAddonVariantProps) => InputAddonVariantProps
31
+ variantMap: InputAddonVariantMap
32
+ variantKeys: Array<keyof InputAddonVariant>
33
+ splitVariantProps<Props extends InputAddonVariantProps>(props: Props): [InputAddonVariantProps, Pretty<DistributiveOmit<Props, keyof InputAddonVariantProps>>]
34
+ getVariantProps: (props?: InputAddonVariantProps) => InputAddonVariantProps
35
+ }
36
+
37
+
38
+ export declare const inputAddon: InputAddonRecipe
@@ -0,0 +1,40 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const inputAddonFn = /* @__PURE__ */ createRecipe('input-addon', {
5
+ "size": "md",
6
+ "variant": "outline"
7
+ }, [])
8
+
9
+ const inputAddonVariantMap = {
10
+ "variant": [
11
+ "outline",
12
+ "surface",
13
+ "subtle"
14
+ ],
15
+ "size": [
16
+ "xs",
17
+ "sm",
18
+ "md",
19
+ "lg",
20
+ "xl"
21
+ ]
22
+ }
23
+
24
+ const inputAddonVariantKeys = Object.keys(inputAddonVariantMap)
25
+
26
+ export const inputAddon = /* @__PURE__ */ Object.assign(memo(inputAddonFn.recipeFn), {
27
+ __recipe__: true,
28
+ __name__: 'inputAddon',
29
+ __getCompoundVariantCss__: inputAddonFn.__getCompoundVariantCss__,
30
+ raw: (props) => props,
31
+ variantKeys: inputAddonVariantKeys,
32
+ variantMap: inputAddonVariantMap,
33
+ merge(recipe) {
34
+ return mergeRecipes(this, recipe)
35
+ },
36
+ splitVariantProps(props) {
37
+ return splitProps(props, inputAddonVariantKeys)
38
+ },
39
+ getVariantProps: inputAddonFn.getVariantProps,
40
+ })
@@ -0,0 +1,34 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface InputGroupVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "xs" | "sm" | "md" | "lg" | "xl"
10
+ }
11
+
12
+ type InputGroupVariantMap = {
13
+ [key in keyof InputGroupVariant]: Array<InputGroupVariant[key]>
14
+ }
15
+
16
+ type InputGroupSlot = "root" | "element"
17
+
18
+ export type InputGroupVariantProps = {
19
+ [key in keyof InputGroupVariant]?: ConditionalValue<InputGroupVariant[key]> | undefined
20
+ }
21
+
22
+ export interface InputGroupRecipe {
23
+ __slot: InputGroupSlot
24
+ __type: InputGroupVariantProps
25
+ (props?: InputGroupVariantProps): Pretty<Record<InputGroupSlot, string>>
26
+ raw: (props?: InputGroupVariantProps) => InputGroupVariantProps
27
+ variantMap: InputGroupVariantMap
28
+ variantKeys: Array<keyof InputGroupVariant>
29
+ splitVariantProps<Props extends InputGroupVariantProps>(props: Props): [InputGroupVariantProps, Pretty<DistributiveOmit<Props, keyof InputGroupVariantProps>>]
30
+ getVariantProps: (props?: InputGroupVariantProps) => InputGroupVariantProps
31
+ }
32
+
33
+
34
+ export declare const inputGroup: InputGroupRecipe
@@ -0,0 +1,49 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const inputGroupDefaultVariants = {
5
+ "size": "md"
6
+ }
7
+ const inputGroupCompoundVariants = []
8
+
9
+ const inputGroupSlotNames = [
10
+ [
11
+ "root",
12
+ "input-group__root"
13
+ ],
14
+ [
15
+ "element",
16
+ "input-group__element"
17
+ ]
18
+ ]
19
+ const inputGroupSlotFns = /* @__PURE__ */ inputGroupSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, inputGroupDefaultVariants, getSlotCompoundVariant(inputGroupCompoundVariants, slotName))])
20
+
21
+ const inputGroupFn = memo((props = {}) => {
22
+ return Object.fromEntries(inputGroupSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
23
+ })
24
+
25
+ const inputGroupVariantKeys = [
26
+ "size"
27
+ ]
28
+ const getVariantProps = (variants) => ({ ...inputGroupDefaultVariants, ...compact(variants) })
29
+
30
+ export const inputGroup = /* @__PURE__ */ Object.assign(inputGroupFn, {
31
+ __recipe__: false,
32
+ __name__: 'inputGroup',
33
+ raw: (props) => props,
34
+ classNameMap: {},
35
+ variantKeys: inputGroupVariantKeys,
36
+ variantMap: {
37
+ "size": [
38
+ "xs",
39
+ "sm",
40
+ "md",
41
+ "lg",
42
+ "xl"
43
+ ]
44
+ },
45
+ splitVariantProps(props) {
46
+ return splitProps(props, inputGroupVariantKeys)
47
+ },
48
+ getVariantProps
49
+ })
@@ -11,6 +11,10 @@ variant: "solid"
11
11
  * @default "md"
12
12
  */
13
13
  size: "sm" | "md" | "lg"
14
+ /**
15
+ * @default "vertical"
16
+ */
17
+ orientation: "horizontal" | "vertical"
14
18
  }
15
19
 
16
20
  type RadioGroupVariantMap = {
@@ -3,7 +3,8 @@ import { createRecipe } from './create-recipe.mjs';
3
3
 
4
4
  const radioGroupDefaultVariants = {
5
5
  "variant": "solid",
6
- "size": "md"
6
+ "size": "md",
7
+ "orientation": "vertical"
7
8
  }
8
9
  const radioGroupCompoundVariants = []
9
10
 
@@ -41,7 +42,8 @@ const radioGroupFn = memo((props = {}) => {
41
42
 
42
43
  const radioGroupVariantKeys = [
43
44
  "variant",
44
- "size"
45
+ "size",
46
+ "orientation"
45
47
  ]
46
48
  const getVariantProps = (variants) => ({ ...radioGroupDefaultVariants, ...compact(variants) })
47
49
 
@@ -59,6 +61,10 @@ export const radioGroup = /* @__PURE__ */ Object.assign(radioGroupFn, {
59
61
  "sm",
60
62
  "md",
61
63
  "lg"
64
+ ],
65
+ "orientation": [
66
+ "horizontal",
67
+ "vertical"
62
68
  ]
63
69
  },
64
70
  splitVariantProps(props) {