@metamask-previews/design-system-react 0.0.0-preview.04cb60f
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/CHANGELOG.md +10 -0
- package/LICENSE +20 -0
- package/README.md +15 -0
- package/dist/components/button/Button.cjs +10 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.d.cts +7 -0
- package/dist/components/button/Button.d.cts.map +1 -0
- package/dist/components/button/Button.d.mts +7 -0
- package/dist/components/button/Button.d.mts.map +1 -0
- package/dist/components/button/Button.mjs +10 -0
- package/dist/components/button/Button.mjs.map +1 -0
- package/dist/components/button/index.cjs +6 -0
- package/dist/components/button/index.cjs.map +1 -0
- package/dist/components/button/index.d.cts +3 -0
- package/dist/components/button/index.d.cts.map +1 -0
- package/dist/components/button/index.d.mts +3 -0
- package/dist/components/button/index.d.mts.map +1 -0
- package/dist/components/button/index.mjs +2 -0
- package/dist/components/button/index.mjs.map +1 -0
- package/dist/components/index.cjs +16 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +6 -0
- package/dist/components/index.d.cts.map +1 -0
- package/dist/components/index.d.mts +6 -0
- package/dist/components/index.d.mts.map +1 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/text/Text.cjs +20 -0
- package/dist/components/text/Text.cjs.map +1 -0
- package/dist/components/text/Text.constants.cjs +27 -0
- package/dist/components/text/Text.constants.cjs.map +1 -0
- package/dist/components/text/Text.constants.d.cts +5 -0
- package/dist/components/text/Text.constants.d.cts.map +1 -0
- package/dist/components/text/Text.constants.d.mts +5 -0
- package/dist/components/text/Text.constants.d.mts.map +1 -0
- package/dist/components/text/Text.constants.mjs +24 -0
- package/dist/components/text/Text.constants.mjs.map +1 -0
- package/dist/components/text/Text.d.cts +4 -0
- package/dist/components/text/Text.d.cts.map +1 -0
- package/dist/components/text/Text.d.mts +4 -0
- package/dist/components/text/Text.d.mts.map +1 -0
- package/dist/components/text/Text.mjs +20 -0
- package/dist/components/text/Text.mjs.map +1 -0
- package/dist/components/text/Text.types.cjs +96 -0
- package/dist/components/text/Text.types.cjs.map +1 -0
- package/dist/components/text/Text.types.d.cts +147 -0
- package/dist/components/text/Text.types.d.cts.map +1 -0
- package/dist/components/text/Text.types.d.mts +147 -0
- package/dist/components/text/Text.types.d.mts.map +1 -0
- package/dist/components/text/Text.types.mjs +93 -0
- package/dist/components/text/Text.types.mjs.map +1 -0
- package/dist/components/text/index.cjs +14 -0
- package/dist/components/text/index.cjs.map +1 -0
- package/dist/components/text/index.d.cts +4 -0
- package/dist/components/text/index.d.cts.map +1 -0
- package/dist/components/text/index.d.mts +4 -0
- package/dist/components/text/index.d.mts.map +1 -0
- package/dist/components/text/index.mjs +3 -0
- package/dist/components/text/index.mjs.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/tw-merge.cjs +67 -0
- package/dist/utils/tw-merge.cjs.map +1 -0
- package/dist/utils/tw-merge.d.cts +13 -0
- package/dist/utils/tw-merge.d.cts.map +1 -0
- package/dist/utils/tw-merge.d.mts +13 -0
- package/dist/utils/tw-merge.d.mts.map +1 -0
- package/dist/utils/tw-merge.mjs +64 -0
- package/dist/utils/tw-merge.mjs.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
2
|
+
const variantClassGroups = [
|
|
3
|
+
's-display-md',
|
|
4
|
+
's-heading-lg',
|
|
5
|
+
's-heading-md',
|
|
6
|
+
's-heading-sm',
|
|
7
|
+
's-body-lg',
|
|
8
|
+
's-body-md',
|
|
9
|
+
's-body-sm',
|
|
10
|
+
's-body-xs',
|
|
11
|
+
'l-display-md',
|
|
12
|
+
'l-heading-lg',
|
|
13
|
+
'l-heading-md',
|
|
14
|
+
'l-heading-sm',
|
|
15
|
+
'l-body-lg',
|
|
16
|
+
'l-body-md',
|
|
17
|
+
'l-body-sm',
|
|
18
|
+
'l-body-xs',
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Custom Tailwind Merge configuration to handle our design system's typography classes.
|
|
22
|
+
* This extends the default Tailwind Merge behavior to properly handle conflicts between:
|
|
23
|
+
* 1. Custom text color classes (text-default, text-alternative, text-muted)
|
|
24
|
+
* 2. Typography variant classes for font sizes (e.g., s-body-md, l-heading-lg)
|
|
25
|
+
* 3. Standard and custom font weight classes
|
|
26
|
+
*
|
|
27
|
+
* Without this configuration, Tailwind Merge wouldn't know these classes are meant
|
|
28
|
+
* to override each other, potentially leading to multiple conflicting classes
|
|
29
|
+
* being applied simultaneously.
|
|
30
|
+
*/
|
|
31
|
+
export const twMerge = extendTailwindMerge({
|
|
32
|
+
extend: {
|
|
33
|
+
classGroups: {
|
|
34
|
+
'text-color': ['text-default', 'text-alternative', 'text-muted'],
|
|
35
|
+
'font-size': [
|
|
36
|
+
{
|
|
37
|
+
text: variantClassGroups,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
'font-weight': [
|
|
41
|
+
// Standard Tailwind font weights
|
|
42
|
+
'font-thin',
|
|
43
|
+
'font-extralight',
|
|
44
|
+
'font-light',
|
|
45
|
+
'font-normal',
|
|
46
|
+
'font-medium',
|
|
47
|
+
'font-semibold',
|
|
48
|
+
'font-bold',
|
|
49
|
+
'font-extrabold',
|
|
50
|
+
'font-black',
|
|
51
|
+
// Custom typography classes
|
|
52
|
+
{
|
|
53
|
+
font: variantClassGroups,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
conflictingClassGroups: {
|
|
58
|
+
'text-color': ['text-color'],
|
|
59
|
+
'font-size': ['font-size'],
|
|
60
|
+
'font-weight': ['font-weight'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=tw-merge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tw-merge.mjs","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB;AAErD,MAAM,kBAAkB,GAAG;IACzB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;CACZ,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;IACzC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC;YAChE,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,kBAAkB;iBACzB;aACF;YACD,aAAa,EAAE;gBACb,iCAAiC;gBACjC,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,aAAa;gBACb,aAAa;gBACb,eAAe;gBACf,WAAW;gBACX,gBAAgB;gBAChB,YAAY;gBACZ,4BAA4B;gBAC5B;oBACE,IAAI,EAAE,kBAAkB;iBACzB;aACF;SACF;QACD,sBAAsB,EAAE;YACtB,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,WAAW,EAAE,CAAC,WAAW,CAAC;YAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;SAC/B;KACF;CACF,CAAC,CAAC","sourcesContent":["import { extendTailwindMerge } from 'tailwind-merge';\n\nconst variantClassGroups = [\n 's-display-md',\n 's-heading-lg',\n 's-heading-md',\n 's-heading-sm',\n 's-body-lg',\n 's-body-md',\n 's-body-sm',\n 's-body-xs',\n 'l-display-md',\n 'l-heading-lg',\n 'l-heading-md',\n 'l-heading-sm',\n 'l-body-lg',\n 'l-body-md',\n 'l-body-sm',\n 'l-body-xs',\n];\n\n/**\n * Custom Tailwind Merge configuration to handle our design system's typography classes.\n * This extends the default Tailwind Merge behavior to properly handle conflicts between:\n * 1. Custom text color classes (text-default, text-alternative, text-muted)\n * 2. Typography variant classes for font sizes (e.g., s-body-md, l-heading-lg)\n * 3. Standard and custom font weight classes\n *\n * Without this configuration, Tailwind Merge wouldn't know these classes are meant\n * to override each other, potentially leading to multiple conflicting classes\n * being applied simultaneously.\n */\nexport const twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'text-color': ['text-default', 'text-alternative', 'text-muted'],\n 'font-size': [\n {\n text: variantClassGroups,\n },\n ],\n 'font-weight': [\n // Standard Tailwind font weights\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n // Custom typography classes\n {\n font: variantClassGroups,\n },\n ],\n },\n conflictingClassGroups: {\n 'text-color': ['text-color'],\n 'font-size': ['font-size'],\n 'font-weight': ['font-weight'],\n },\n },\n});\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@metamask-previews/design-system-react",
|
|
3
|
+
"version": "0.0.0-preview.04cb60f",
|
|
4
|
+
"description": "Design system react ui components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"MetaMask",
|
|
7
|
+
"Ethereum"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/MetaMask/metamask-design-system/tree/main/packages/design-system-react#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/MetaMask/metamask-design-system/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/MetaMask/metamask-design-system.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
23
|
+
"default": "./dist/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/index.d.cts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"main": "./dist/index.cjs",
|
|
33
|
+
"types": "./dist/index.d.cts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist/"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
|
|
39
|
+
"changelog:update": "../../scripts/update-changelog.sh @metamask/design-system-react",
|
|
40
|
+
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/design-system-react",
|
|
41
|
+
"publish:preview": "yarn npm publish --tag preview",
|
|
42
|
+
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
43
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
|
|
44
|
+
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
|
|
45
|
+
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
|
|
46
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
50
|
+
"tailwind-merge": "^2.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@metamask-previews/design-system-tailwind-preset": "0.0.0-preview.04cb60f",
|
|
54
|
+
"@metamask/auto-changelog": "^3.4.4",
|
|
55
|
+
"@storybook/react": "^8.3.5",
|
|
56
|
+
"@storybook/test": "^8.3.5",
|
|
57
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
58
|
+
"@testing-library/react": "^16.0.1",
|
|
59
|
+
"@types/jest": "^27.4.1",
|
|
60
|
+
"@types/react": "^18.2.0",
|
|
61
|
+
"@types/react-dom": "^18.2.0",
|
|
62
|
+
"deepmerge": "^4.2.2",
|
|
63
|
+
"jest": "^29.7.0",
|
|
64
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
65
|
+
"ts-jest": "^29.2.5",
|
|
66
|
+
"typescript": "~5.2.2"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"@metamask/design-tokens": "^4.1.0",
|
|
70
|
+
"react": "^16.0.0",
|
|
71
|
+
"react-dom": "^16.0.0",
|
|
72
|
+
"tailwindcss": "^3.0.0"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": "^18.18 || >=20"
|
|
76
|
+
},
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public",
|
|
79
|
+
"registry": "https://registry.npmjs.org/"
|
|
80
|
+
}
|
|
81
|
+
}
|