@zidian-ui/core 0.1.4 → 0.2.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.
Files changed (86) hide show
  1. package/esm/assets/packages/@zidian-ui/core/src/components/collection/List/List.css.ts.vanilla-BeW6Frwm.css +27 -0
  2. package/esm/assets/packages/@zidian-ui/core/src/components/common/Button/Button.css.ts.vanilla-BgimV8hB.css +183 -0
  3. package/esm/assets/packages/@zidian-ui/core/src/components/common/Tag/Tag.css.ts.vanilla-lf0HgPmO.css +103 -0
  4. package/esm/assets/packages/@zidian-ui/core/src/components/input/SelectWrapper/SelectWrapper.css.ts.vanilla-C2qmBkSh.css +17 -0
  5. package/esm/assets/packages/@zidian-ui/core/src/components/input/components/inputInner/InputInner.css.ts.vanilla-Dylafkkf.css +150 -0
  6. package/esm/assets/packages/@zidian-ui/core/src/components/modal/Drawer/Drawer.css.ts.vanilla-g4GnhXaQ.css +45 -0
  7. package/esm/assets/packages/@zidian-ui/core/src/components/other/Cascader/Cascader.css.ts.vanilla-Bp7URCRM.css +49 -0
  8. package/esm/components/collection/List/List.css.js +9 -0
  9. package/esm/components/collection/List/List.js +71 -0
  10. package/esm/components/collection/List/components/DefaultContentPlace.js +63 -0
  11. package/esm/components/collection/List/components/DefaultItemPlace.js +50 -0
  12. package/esm/components/common/Button/Button.css.js +6 -0
  13. package/esm/components/common/Button/Button.js +42 -0
  14. package/esm/components/common/Tag/Tag.css.js +6 -0
  15. package/esm/components/common/Tag/Tag.js +29 -0
  16. package/esm/components/input/SelectWrapper/SelectWrapper.css.js +6 -0
  17. package/esm/components/input/SelectWrapper/SelectWrapper.js +51 -0
  18. package/esm/components/input/SelectWrapper/components/SelectWrapperPortal/SelectWrapperPortal.js +23 -0
  19. package/esm/components/input/SelectWrapper/components/SelectWrapperValue/SelectWrapperValue.js +22 -0
  20. package/esm/components/input/components/inputInner/InputInner.css.js +8 -0
  21. package/esm/components/input/components/inputInner/InputInner.js +21 -0
  22. package/esm/components/modal/Drawer/Drawer.css.js +7 -0
  23. package/esm/components/modal/Drawer/Drawer.js +54 -0
  24. package/esm/components/other/Cascader/Cascader.css.js +10 -0
  25. package/esm/components/other/Cascader/Cascader.js +109 -0
  26. package/esm/external/.pnpm/@vanilla-extract_recipes@0.5.7_@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +111 -0
  27. package/esm/index.js +13 -0
  28. package/esm/theme/provider/ThemeProvider.js +34 -0
  29. package/esm/theme/token/contract.js +128 -0
  30. package/esm/theme/token/tokenMap.js +52 -0
  31. package/esm/theme/token/tokenSetup.js +87 -0
  32. package/esm/theme/utils/color.js +42 -0
  33. package/esm/theme/utils/contract.js +15 -0
  34. package/esm/theme/utils/token.js +39 -0
  35. package/lib/components/collection/List/List.css.d.ts +5 -0
  36. package/lib/components/collection/List/List.d.ts +1 -0
  37. package/lib/components/collection/List/List.prop.d.ts +13 -0
  38. package/lib/components/collection/List/components/DefaultContentPlace.d.ts +1 -0
  39. package/lib/components/collection/List/components/DefaultItemPlace.d.ts +1 -0
  40. package/lib/components/collection/List/index.d.ts +2 -0
  41. package/lib/components/collection/index.d.ts +1 -0
  42. package/lib/components/common/Button/Button.css.d.ts +137 -0
  43. package/lib/components/common/Button/Button.d.ts +2 -0
  44. package/lib/components/common/Button/Button.props.d.ts +10 -0
  45. package/lib/components/common/Button/index.d.ts +2 -0
  46. package/lib/components/common/Tag/Tag.css.d.ts +67 -0
  47. package/lib/components/common/Tag/Tag.d.ts +2 -0
  48. package/lib/components/common/Tag/Tag.props.d.ts +8 -0
  49. package/lib/components/common/Tag/index.d.ts +2 -0
  50. package/lib/components/common/index.d.ts +2 -0
  51. package/lib/components/index.d.ts +5 -0
  52. package/lib/components/input/SelectWrapper/SelectWrapper.css.d.ts +2 -0
  53. package/lib/components/input/SelectWrapper/SelectWrapper.d.ts +2 -0
  54. package/lib/components/input/SelectWrapper/SelectWrapper.props.d.ts +32 -0
  55. package/lib/components/input/SelectWrapper/components/SelectWrapperPortal/SelectWrapperPortal.d.ts +10 -0
  56. package/lib/components/input/SelectWrapper/components/SelectWrapperValue/SelectWrapperValue.d.ts +7 -0
  57. package/lib/components/input/SelectWrapper/index.d.ts +2 -0
  58. package/lib/components/input/components/inputInner/InputInner.css.d.ts +92 -0
  59. package/lib/components/input/components/inputInner/InputInner.d.ts +2 -0
  60. package/lib/components/input/components/inputInner/inputInner.props.d.ts +11 -0
  61. package/lib/components/input/index.d.ts +1 -0
  62. package/lib/components/modal/Drawer/Drawer.css.d.ts +34 -0
  63. package/lib/components/modal/Drawer/Drawer.d.ts +2 -0
  64. package/lib/components/modal/Drawer/Drawer.props.d.ts +10 -0
  65. package/lib/components/modal/Drawer/index.d.ts +2 -0
  66. package/lib/components/modal/index.d.ts +1 -0
  67. package/lib/components/other/Cascader/Cascader.css.d.ts +6 -0
  68. package/lib/components/other/Cascader/Cascader.d.ts +2 -0
  69. package/lib/components/other/Cascader/Cascader.props.d.ts +17 -0
  70. package/lib/components/other/Cascader/index.d.ts +2 -0
  71. package/lib/components/other/index.d.ts +1 -0
  72. package/lib/index.d.ts +2 -0
  73. package/lib/theme/common/common.css.d.ts +1 -0
  74. package/lib/theme/common/motion.d.ts +0 -0
  75. package/lib/theme/contract/colorContract.css.d.ts +8 -0
  76. package/lib/theme/contract/themeContract.css.d.ts +134 -0
  77. package/lib/theme/index.d.ts +8 -0
  78. package/lib/theme/provider/ThemeProvider.d.ts +9 -0
  79. package/lib/theme/token/contract.d.ts +169 -0
  80. package/lib/theme/token/tokenMap.d.ts +90 -0
  81. package/lib/theme/token/tokenSetup.d.ts +85 -0
  82. package/lib/theme/types/token.d.ts +41 -0
  83. package/lib/theme/utils/color.d.ts +37 -0
  84. package/lib/theme/utils/contract.d.ts +2 -0
  85. package/lib/theme/utils/token.d.ts +19 -0
  86. package/package.json +5 -5
@@ -0,0 +1,90 @@
1
+ export declare const defaultColorMap: {
2
+ main: {
3
+ main: {
4
+ light: number;
5
+ dark: number;
6
+ };
7
+ onMain: {
8
+ light: number;
9
+ dark: number;
10
+ };
11
+ container: {
12
+ light: number;
13
+ dark: number;
14
+ };
15
+ onContainer: {
16
+ light: number;
17
+ dark: number;
18
+ };
19
+ };
20
+ neutral: {
21
+ dim: {
22
+ light: number;
23
+ dark: number;
24
+ };
25
+ main: {
26
+ light: number;
27
+ dark: number;
28
+ };
29
+ bright: {
30
+ light: number;
31
+ dark: number;
32
+ };
33
+ onMain: {
34
+ light: number;
35
+ dark: number;
36
+ };
37
+ containerLowest: {
38
+ light: number;
39
+ dark: number;
40
+ };
41
+ containerLow: {
42
+ light: number;
43
+ dark: number;
44
+ };
45
+ container: {
46
+ light: number;
47
+ dark: number;
48
+ };
49
+ containerHigh: {
50
+ light: number;
51
+ dark: number;
52
+ };
53
+ containerHighest: {
54
+ light: number;
55
+ dark: number;
56
+ };
57
+ };
58
+ neutralVariant: {
59
+ main: {
60
+ light: number;
61
+ dark: number;
62
+ };
63
+ variant: {
64
+ light: number;
65
+ dark: number;
66
+ };
67
+ onSurfaceVariant: {
68
+ light: number;
69
+ dark: number;
70
+ };
71
+ outlineVariant: {
72
+ light: number;
73
+ dark: number;
74
+ };
75
+ };
76
+ inverse: {
77
+ primary: {
78
+ light: number;
79
+ dark: number;
80
+ };
81
+ surface: {
82
+ light: number;
83
+ dark: number;
84
+ };
85
+ onSurface: {
86
+ light: number;
87
+ dark: number;
88
+ };
89
+ };
90
+ };
@@ -0,0 +1,85 @@
1
+ export declare const colorSetup: {
2
+ main: {
3
+ primary: string;
4
+ secondary: string;
5
+ tertiary: string;
6
+ };
7
+ other: {
8
+ info: string;
9
+ error: string;
10
+ warning: string;
11
+ success: string;
12
+ };
13
+ neutral: {
14
+ surface: string;
15
+ };
16
+ neutralVariant: {
17
+ outline: string;
18
+ };
19
+ };
20
+ export declare const otherSetup: {
21
+ font: {
22
+ size: {
23
+ title: {
24
+ xs: string;
25
+ sm: string;
26
+ md: string;
27
+ lg: string;
28
+ xl: string;
29
+ };
30
+ label: {
31
+ xs: string;
32
+ sm: string;
33
+ md: string;
34
+ lg: string;
35
+ xl: string;
36
+ };
37
+ };
38
+ weight: {
39
+ lighter: number;
40
+ light: number;
41
+ normal: number;
42
+ medium: number;
43
+ bold: number;
44
+ bolder: number;
45
+ };
46
+ lineHeight: {
47
+ xs: number;
48
+ sm: number;
49
+ md: number;
50
+ lg: number;
51
+ xl: number;
52
+ };
53
+ };
54
+ radius: {
55
+ sm: string;
56
+ md: string;
57
+ lg: string;
58
+ xl: string;
59
+ full: string;
60
+ };
61
+ spacing: {
62
+ layout: {
63
+ xs: string;
64
+ sm: string;
65
+ md: string;
66
+ lg: string;
67
+ xl: string;
68
+ };
69
+ content: {
70
+ xs: string;
71
+ sm: string;
72
+ md: string;
73
+ lg: string;
74
+ xl: string;
75
+ };
76
+ };
77
+ };
78
+ export declare const interactionSetup: {
79
+ state: {
80
+ hover: number;
81
+ focus: number;
82
+ pressed: number;
83
+ dragged: number;
84
+ };
85
+ };
@@ -0,0 +1,41 @@
1
+ export type OnString = `on${Capitalize<string>}`;
2
+ export type Container = `container`;
3
+ export type ContainerString = `container${Capitalize<string>}`;
4
+ export type ColorTokenValueType = string;
5
+ export type TokenValue = ColorTokenValueType | number;
6
+ /****** Color ******/
7
+ export type ColorTokenRoleType = OnString | Container | ContainerString | (string & {});
8
+ export type NormalColorTokenType = {
9
+ main: string;
10
+ onMain: string;
11
+ container: string;
12
+ onContainer: string;
13
+ };
14
+ export type SpecialColorTokenType = {
15
+ dim: string;
16
+ bright: string;
17
+ main: string;
18
+ onMain: string;
19
+ container: string;
20
+ containerLow: string;
21
+ containerHigh: string;
22
+ containerLowest: string;
23
+ containerHighest: string;
24
+ };
25
+ export type ColorToken = {
26
+ [key: string]: ColorTokenValueType | Record<ColorTokenRoleType, ColorTokenValueType>;
27
+ };
28
+ /****** Other ******/
29
+ export type OtherToken = {
30
+ [key: string]: TokenValue | OtherToken;
31
+ };
32
+ /****** Token ******/
33
+ export type Token = {
34
+ color: Record<string, ColorToken>;
35
+ } & {
36
+ [key: string]: OtherToken;
37
+ };
38
+ export type TokenStructure<T> = {
39
+ [K in keyof T]: T[K] extends object ? TokenStructure<T[K]> : string;
40
+ };
41
+ export type TokenHandler = (key: string, value: TokenValue, path: string[], isColor: boolean, type: string) => void;
@@ -0,0 +1,37 @@
1
+ import { AnyColor } from "colord";
2
+ import { TonalPalette } from "@material/material-color-utilities";
3
+ /**
4
+ * @desc Create seed color info
5
+ * @param color Seed color value
6
+ * @param colorName Seed color name
7
+ */
8
+ export declare function createSourceColor(colorName: string, color: string): {
9
+ name: string;
10
+ level: number;
11
+ color: string;
12
+ colorInt: number;
13
+ };
14
+ /**
15
+ * @desc Create tonal palette by source color int
16
+ * @param seedColorInt The seed color int
17
+ */
18
+ export declare function createTonalPalette(seedColorInt: number): TonalPalette;
19
+ export declare function transHctToHex(tonalPalette: TonalPalette, level: number): string;
20
+ /**
21
+ * @desc Create palette by levels and source color
22
+ * @param seedColorInt The seed color int
23
+ * @param levels Level list for get one of the tonalPalette
24
+ * @param colorType Return color value's type
25
+ */
26
+ export declare function createPalette(levels: number[], seedColorInt: number, colorType?: AnyColor): {
27
+ name: string;
28
+ level: number;
29
+ value: string;
30
+ }[];
31
+ /**
32
+ * @desc Generate tonal range from 0 to 100 for continuous color gradient
33
+ * @param hex The hex color value
34
+ * @param step The step interval for generating colors (default: 1)
35
+ * @returns Array of color values with levels from 0 to 100
36
+ */
37
+ export declare function getTonalRange(colorInt: any, step?: number): string[];
@@ -0,0 +1,2 @@
1
+ import { TokenContract, TokenContractStruct } from "../token/contract";
2
+ export declare function createContract(contractStruct: TokenContractStruct): TokenContract;
@@ -0,0 +1,19 @@
1
+ import type { TokenHandler, Token } from "../../../src/theme/types/token";
2
+ /**
3
+ * @desc Process a token by flattening it and calling the handler for each entry
4
+ * @param token The token to process
5
+ * @param handler The handler function to call for each token entry
6
+ */
7
+ export declare function handleToken(token: Token, handler: TokenHandler): void;
8
+ /**
9
+ * @desc Create semantic token from semantic definitions
10
+ * @param semantic Semantic token definitions
11
+ * @returns Flattened semantic token object with CSS variables
12
+ */
13
+ export declare function createSemanticTokenVars(semantic: Token): Record<string, string | number>;
14
+ /**
15
+ * @desc Generate color contract from color token
16
+ * @param colorToken Color token object
17
+ * @returns Color contract object
18
+ */
19
+ export declare function createColorToken(contract: Record<string, any>, globalContract: Record<string, any>, colorNames: readonly string[]): Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zidian-ui/core",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "source": "./src/index.ts",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,12 +28,10 @@
28
28
  ],
29
29
  "author": "GWR",
30
30
  "peerDependencies": {
31
- "@radix-ui/react-slot": "^1.2.4",
32
- "@radix-ui/react-visually-hidden": "^1.2.4",
33
31
  "motion": "^12.23.25",
34
32
  "react": "^18.x || ^19.x",
35
33
  "react-dom": "^18.x || ^19.x",
36
- "@zidian-primitive/cascader": "^0.1.1"
34
+ "@zidian-primitive/cascader": "^0.1.2"
37
35
  },
38
36
  "devDependencies": {
39
37
  "motion": "^12.23.25",
@@ -43,6 +41,8 @@
43
41
  "dependencies": {
44
42
  "@material/material-color-utilities": "^0.3.0",
45
43
  "@radix-ui/react-dialog": "^1.1.15",
44
+ "@radix-ui/react-popover": "^1.1.15",
45
+ "@radix-ui/react-select": "^2.2.6",
46
46
  "@radix-ui/react-slot": "^1.2.4",
47
47
  "@radix-ui/react-visually-hidden": "^1.2.4",
48
48
  "@vanilla-extract/css": "^1.18.0",
@@ -53,7 +53,7 @@
53
53
  "flat": "^6.0.1",
54
54
  "lucide-react": "^0.554.0",
55
55
  "react-loader-spinner": "^7.0.3",
56
- "@zidian-primitive/cascader": "^0.1.1",
56
+ "@zidian-primitive/cascader": "^0.1.2",
57
57
  "@zidian-primitive/list": "^0.1.0"
58
58
  }
59
59
  }