@gobolt/genesis 0.0.7
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 +86 -0
- package/dist/AntdIcon-Bsnbyy6g.js +200 -0
- package/dist/CheckOutlined-DAynWe12.js +527 -0
- package/dist/CloseCircleFilled-ZIY-u-27.js +13 -0
- package/dist/Compact-CJBo3f0u.js +185 -0
- package/dist/ContextIsolator-CGkdKtc3.js +20 -0
- package/dist/ExclamationCircleFilled-BICVVQIg.js +21 -0
- package/dist/Form-Cylpi4M4.js +1815 -0
- package/dist/Overflow-CP1M4Z0s.js +369 -0
- package/dist/SearchOutlined-DuzJkIiQ.js +52 -0
- package/dist/TextArea-3MOYYuAQ.js +1680 -0
- package/dist/bundle.css +1 -0
- package/dist/button-BNV2qdrP.js +1392 -0
- package/dist/compact-item-DH13cl8A.js +61 -0
- package/dist/components/atoms/button/Button.d.ts +12 -0
- package/dist/components/atoms/button/Button.js +27 -0
- package/dist/components/atoms/button/__stories__/Button.stories.d.ts +13 -0
- package/dist/components/atoms/button/index.d.ts +2 -0
- package/dist/components/atoms/button/index.js +4 -0
- package/dist/components/atoms/button/styles.d.ts +12 -0
- package/dist/components/atoms/button/styles.js +71 -0
- package/dist/components/atoms/checkbox/Checkbox.d.ts +10 -0
- package/dist/components/atoms/checkbox/Checkbox.js +13 -0
- package/dist/components/atoms/checkbox/__stories__/Checkbox.stories.d.ts +8 -0
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +18 -0
- package/dist/components/atoms/checkbox/index.d.ts +2 -0
- package/dist/components/atoms/checkbox/index.js +4 -0
- package/dist/components/atoms/checkbox/styles.d.ts +11 -0
- package/dist/components/atoms/checkbox/styles.js +582 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/atoms/index.js +3 -0
- package/dist/components/atoms/input/Input.d.ts +11 -0
- package/dist/components/atoms/input/Input.js +12 -0
- package/dist/components/atoms/input/__stories__/Input.stories.d.ts +10 -0
- package/dist/components/atoms/input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/atoms/input/__tests__/Input.test.js +28 -0
- package/dist/components/atoms/input/index.d.ts +2 -0
- package/dist/components/atoms/input/index.js +4 -0
- package/dist/components/atoms/input/styles.d.ts +14 -0
- package/dist/components/atoms/input/styles.js +415 -0
- package/dist/components/atoms/select/Select.d.ts +11 -0
- package/dist/components/atoms/select/Select.js +24 -0
- package/dist/components/atoms/select/__stories__/Select.stories.d.ts +8 -0
- package/dist/components/atoms/select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/atoms/select/__tests__/Select.test.js +10735 -0
- package/dist/components/atoms/select/index.d.ts +2 -0
- package/dist/components/atoms/select/index.js +4 -0
- package/dist/components/atoms/select/styles.d.ts +15 -0
- package/dist/components/atoms/select/styles.js +3868 -0
- package/dist/components/atoms/typography/Typography.d.ts +11 -0
- package/dist/components/atoms/typography/Typography.js +44 -0
- package/dist/components/atoms/typography/__stories__/Typography.stories.d.ts +12 -0
- package/dist/components/atoms/typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/atoms/typography/__tests__/Typography.test.js +16 -0
- package/dist/components/atoms/typography/index.d.ts +2 -0
- package/dist/components/atoms/typography/index.js +4 -0
- package/dist/components/atoms/typography/styles.d.ts +11 -0
- package/dist/components/atoms/typography/styles.js +28 -0
- package/dist/components/index.d.js +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +16 -0
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.d.ts +10 -0
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +35 -0
- package/dist/components/molecules/error-boundary-fallback/__stories__/ErrorBoundaryFallback.stories.d.ts +8 -0
- package/dist/components/molecules/error-boundary-fallback/index.d.ts +1 -0
- package/dist/components/molecules/error-boundary-fallback/index.js +4 -0
- package/dist/components/molecules/error-boundary-fallback/styles.d.ts +1 -0
- package/dist/components/molecules/error-boundary-fallback/styles.js +930 -0
- package/dist/components/molecules/form/Form.d.ts +15 -0
- package/dist/components/molecules/form/Form.js +7 -0
- package/dist/components/molecules/form/__stories__/Form.stories.d.ts +7 -0
- package/dist/components/molecules/form/__stories__/FormStory.d.ts +1 -0
- package/dist/components/molecules/form/__stories__/FormStory.js +90 -0
- package/dist/components/molecules/form/index.d.ts +2 -0
- package/dist/components/molecules/form/index.js +4 -0
- package/dist/constants/index.d.ts +51 -0
- package/dist/constants/index.js +54 -0
- package/dist/context-CZsFJmh6.js +2093 -0
- package/dist/declaration.d.js +1 -0
- package/dist/genesis/GenesisThemeBreakdown.d.ts +4 -0
- package/dist/genesis/GenesisThemeBreakdown.js +56 -0
- package/dist/genesis/GenesisThemeDemo.d.ts +8 -0
- package/dist/genesis/GenesisThemeDemo.js +8 -0
- package/dist/genesis/GenesisThemeDemo.stories.d.ts +7 -0
- package/dist/genesis/styles.d.ts +12 -0
- package/dist/genesis/styles.js +4038 -0
- package/dist/index-3MWkSVA1.js +96 -0
- package/dist/index-BPtFqhcp.js +19110 -0
- package/dist/index-BQO27mgE.js +402 -0
- package/dist/index-BWys7dkb.js +4462 -0
- package/dist/index-C7kFNqp2.js +276 -0
- package/dist/index-D1v_7IIx.js +1057 -0
- package/dist/index-SAAXFt-P.js +946 -0
- package/dist/index-VDH3iLaC.js +884 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/isVisible-CNQjrJPN.js +366 -0
- package/dist/magic-string.es-BkUFmFT4.js +858 -0
- package/dist/presetColors-Cl8UP3Nw.js +4 -0
- package/dist/providers/GenesisProvider.d.ts +8 -0
- package/dist/providers/GenesisProvider.js +7 -0
- package/dist/providers/ThemeProvider.d.ts +9 -0
- package/dist/providers/ThemeProvider.js +18 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +6 -0
- package/dist/reactNode-sKPeiqPL.js +12 -0
- package/dist/setup-CMYVZCPF.js +33883 -0
- package/dist/styled-components.browser.esm-CZ1XM4o4.js +1144 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.d.ts +1 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +37 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokens.stories.d.ts +6 -0
- package/dist/styles/design-tokens/color-tokens/ColorTokens.stories.d.ts +7 -0
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.d.ts +3 -0
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +36 -0
- package/dist/styles/design-tokens/sizing-tokens/index.stories.d.ts +7 -0
- package/dist/styles/design-tokens/typography/TypographyTokens.stories.d.ts +7 -0
- package/dist/styles/design-tokens/variables.d.ts +704 -0
- package/dist/styles/design-tokens/variables.js +697 -0
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/global-styles.js +35 -0
- package/dist/styles/theme/genesis-theme.d.ts +75 -0
- package/dist/styles/theme/genesis-theme.js +896 -0
- package/dist/styles/theme/genesis-theme.types.d.ts +162 -0
- package/dist/styles/theme/genesis-theme.types.js +4 -0
- package/dist/styles/theme/global-styles.d.ts +1 -0
- package/dist/styles/theme/global-styles.js +35 -0
- package/dist/styles/theme/index.d.ts +1 -0
- package/dist/styles/theme/index.js +9 -0
- package/dist/test/setup.d.ts +5 -0
- package/dist/test/setup.js +7 -0
- package/dist/useVariants-CEpw6Ww6.js +29 -0
- package/dist/utils/getAppointmentColor.d.ts +4 -0
- package/dist/utils/getAppointmentColor.js +91 -0
- package/dist/utils/isAllEnglishString.d.ts +1 -0
- package/dist/utils/isAllEnglishString.js +8 -0
- package/dist/utils/isAllEnglishString.test.d.ts +1 -0
- package/dist/utils/isAllEnglishString.test.js +8 -0
- package/dist/utils/parseAddress.d.ts +3 -0
- package/dist/utils/parseAddress.js +19 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +115 -0
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# GENESIS Design System
|
|
2
|
+
|
|
3
|
+
 
|
|
4
|
+
|
|
5
|
+
[Storybook hosted on Google Cloud](https://genesis-storybook-365607811897.us-central1.run.app/?path=/docs/genesis-design-system-design-tokens-color-tokens--docs)
|
|
6
|
+
|
|
7
|
+
The GENESIS design system standardizes our colors, fonts, and sizing tokens across all our apps.
|
|
8
|
+
|
|
9
|
+
It unifies frontend app development around these core libraries:
|
|
10
|
+
|
|
11
|
+
- [Antd](https://ant.design/) v5
|
|
12
|
+
- [Styled Components](https://styled-components.com/) v5
|
|
13
|
+
- [Typescript](https://www.typescriptlang.org/) v5
|
|
14
|
+
- [React](https://react.dev/) v18
|
|
15
|
+
|
|
16
|
+
This library is intended to be universally imported into both React & React-Native apps.
|
|
17
|
+
|
|
18
|
+
## 📦 Development
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm install
|
|
22
|
+
pnpm start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To scaffold a new component, run `pnpm generate` and follow the prompts
|
|
26
|
+
|
|
27
|
+
## 🔨 Usage
|
|
28
|
+
|
|
29
|
+
Install the GENESIS library
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
pnpm install @second-closet/genesis
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `GenesisProvider` must included within the application as it supplies the Genesis Theme.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
import { Button, GenesisProvider } from '@gobolt/genesis';
|
|
39
|
+
|
|
40
|
+
const Demo = () = {
|
|
41
|
+
|
|
42
|
+
const onClick = (value) => {
|
|
43
|
+
console.log("Genesis button clicked with value: ", value);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<GenesisProvider>
|
|
48
|
+
<Button onClick={onClick}>Ship</Button>
|
|
49
|
+
</GenesisProvider>
|
|
50
|
+
)
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The library exports both the components and their types which are documented in our storybook.
|
|
55
|
+
|
|
56
|
+
## 🧪 Testing
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
pnpm test
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
[husky](https://typicode.github.io/husky/) has been configured to automatically run the tests on push to Github and will enforce that all tests pass.
|
|
63
|
+
|
|
64
|
+
## 🚀 Publishing
|
|
65
|
+
|
|
66
|
+
This project uses [rollup](https://rollupjs.org/) to create the package and [changesets](https://github.com/changesets/changesets) to manage it's versions. We only need to run changesets when we're ready to release and publish the library.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
npx changeset
|
|
70
|
+
npx changeset version
|
|
71
|
+
npm publish
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 📙 Storybook Deployment to Google Cloud
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
just deploy
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
See the .justfile which simplifies this [Storybook GCP script on Notion](https://www.notion.so/gobolt/Deploy-Genesis-Storybook-to-GCP-1759f4303960806e8d88cf1e751cb19d).
|
|
81
|
+
|
|
82
|
+
requires: [just](https://github.com/casey/just)
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
brew install just
|
|
86
|
+
```
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { w as L, b, a as c, g as U, I, u as W, d as N, e as R, f as q, c as F, h, _ as G } from "./index-BWys7dkb.js";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import x, { useContext as H, useEffect as J } from "react";
|
|
4
|
+
function S(n) {
|
|
5
|
+
var o;
|
|
6
|
+
return n == null || (o = n.getRootNode) === null || o === void 0 ? void 0 : o.call(n);
|
|
7
|
+
}
|
|
8
|
+
function K(n) {
|
|
9
|
+
return S(n) instanceof ShadowRoot;
|
|
10
|
+
}
|
|
11
|
+
function M(n) {
|
|
12
|
+
return K(n) ? S(n) : null;
|
|
13
|
+
}
|
|
14
|
+
function Q(n) {
|
|
15
|
+
return n.replace(/-(.)/g, function(o, e) {
|
|
16
|
+
return e.toUpperCase();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function V(n, o) {
|
|
20
|
+
L(n, "[@ant-design/icons] ".concat(o));
|
|
21
|
+
}
|
|
22
|
+
function _(n) {
|
|
23
|
+
return b(n) === "object" && typeof n.name == "string" && typeof n.theme == "string" && (b(n.icon) === "object" || typeof n.icon == "function");
|
|
24
|
+
}
|
|
25
|
+
function k() {
|
|
26
|
+
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
27
|
+
return Object.keys(n).reduce(function(o, e) {
|
|
28
|
+
var r = n[e];
|
|
29
|
+
switch (e) {
|
|
30
|
+
case "class":
|
|
31
|
+
o.className = r, delete o.class;
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
delete o[e], o[Q(e)] = r;
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
}, {});
|
|
38
|
+
}
|
|
39
|
+
function T(n, o, e) {
|
|
40
|
+
return e ? /* @__PURE__ */ x.createElement(n.tag, c(c({
|
|
41
|
+
key: o
|
|
42
|
+
}, k(n.attrs)), e), (n.children || []).map(function(r, t) {
|
|
43
|
+
return T(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
|
|
44
|
+
})) : /* @__PURE__ */ x.createElement(n.tag, c({
|
|
45
|
+
key: o
|
|
46
|
+
}, k(n.attrs)), (n.children || []).map(function(r, t) {
|
|
47
|
+
return T(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
function z(n) {
|
|
51
|
+
return U(n)[0];
|
|
52
|
+
}
|
|
53
|
+
function E(n) {
|
|
54
|
+
return n ? Array.isArray(n) ? n : [n] : [];
|
|
55
|
+
}
|
|
56
|
+
var X = `
|
|
57
|
+
.anticon {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
color: inherit;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
line-height: 0;
|
|
63
|
+
text-align: center;
|
|
64
|
+
text-transform: none;
|
|
65
|
+
vertical-align: -0.125em;
|
|
66
|
+
text-rendering: optimizeLegibility;
|
|
67
|
+
-webkit-font-smoothing: antialiased;
|
|
68
|
+
-moz-osx-font-smoothing: grayscale;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.anticon > * {
|
|
72
|
+
line-height: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.anticon svg {
|
|
76
|
+
display: inline-block;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.anticon::before {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.anticon .anticon-icon {
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.anticon[tabindex] {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.anticon-spin::before,
|
|
92
|
+
.anticon-spin {
|
|
93
|
+
display: inline-block;
|
|
94
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
95
|
+
animation: loadingCircle 1s infinite linear;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@-webkit-keyframes loadingCircle {
|
|
99
|
+
100% {
|
|
100
|
+
-webkit-transform: rotate(360deg);
|
|
101
|
+
transform: rotate(360deg);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@keyframes loadingCircle {
|
|
106
|
+
100% {
|
|
107
|
+
-webkit-transform: rotate(360deg);
|
|
108
|
+
transform: rotate(360deg);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`, Y = function(o) {
|
|
112
|
+
var e = H(I), r = e.csp, t = e.prefixCls, i = X;
|
|
113
|
+
t && (i = i.replace(/anticon/g, t)), J(function() {
|
|
114
|
+
var l = o.current, s = M(l);
|
|
115
|
+
W(i, "@ant-design-icons", {
|
|
116
|
+
prepend: !0,
|
|
117
|
+
csp: r,
|
|
118
|
+
attachTo: s
|
|
119
|
+
});
|
|
120
|
+
}, []);
|
|
121
|
+
}, Z = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], m = {
|
|
122
|
+
primaryColor: "#333",
|
|
123
|
+
secondaryColor: "#E6E6E6",
|
|
124
|
+
calculated: !1
|
|
125
|
+
};
|
|
126
|
+
function nn(n) {
|
|
127
|
+
var o = n.primaryColor, e = n.secondaryColor;
|
|
128
|
+
m.primaryColor = o, m.secondaryColor = e || z(o), m.calculated = !!e;
|
|
129
|
+
}
|
|
130
|
+
function on() {
|
|
131
|
+
return c({}, m);
|
|
132
|
+
}
|
|
133
|
+
var d = function(o) {
|
|
134
|
+
var e = o.icon, r = o.className, t = o.onClick, i = o.style, l = o.primaryColor, s = o.secondaryColor, y = N(o, Z), C = f.useRef(), u = m;
|
|
135
|
+
if (l && (u = {
|
|
136
|
+
primaryColor: l,
|
|
137
|
+
secondaryColor: s || z(l)
|
|
138
|
+
}), Y(C), V(_(e), "icon should be icon definiton, but got ".concat(e)), !_(e))
|
|
139
|
+
return null;
|
|
140
|
+
var a = e;
|
|
141
|
+
return a && typeof a.icon == "function" && (a = c(c({}, a), {}, {
|
|
142
|
+
icon: a.icon(u.primaryColor, u.secondaryColor)
|
|
143
|
+
})), T(a.icon, "svg-".concat(a.name), c(c({
|
|
144
|
+
className: r,
|
|
145
|
+
onClick: t,
|
|
146
|
+
style: i,
|
|
147
|
+
"data-icon": a.name,
|
|
148
|
+
width: "1em",
|
|
149
|
+
height: "1em",
|
|
150
|
+
fill: "currentColor",
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}, y), {}, {
|
|
153
|
+
ref: C
|
|
154
|
+
}));
|
|
155
|
+
};
|
|
156
|
+
d.displayName = "IconReact";
|
|
157
|
+
d.getTwoToneColors = on;
|
|
158
|
+
d.setTwoToneColors = nn;
|
|
159
|
+
function $(n) {
|
|
160
|
+
var o = E(n), e = R(o, 2), r = e[0], t = e[1];
|
|
161
|
+
return d.setTwoToneColors({
|
|
162
|
+
primaryColor: r,
|
|
163
|
+
secondaryColor: t
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function en() {
|
|
167
|
+
var n = d.getTwoToneColors();
|
|
168
|
+
return n.calculated ? [n.primaryColor, n.secondaryColor] : n.primaryColor;
|
|
169
|
+
}
|
|
170
|
+
var rn = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
171
|
+
$(q.primary);
|
|
172
|
+
var v = /* @__PURE__ */ f.forwardRef(function(n, o) {
|
|
173
|
+
var e = n.className, r = n.icon, t = n.spin, i = n.rotate, l = n.tabIndex, s = n.onClick, y = n.twoToneColor, C = N(n, rn), u = f.useContext(I), a = u.prefixCls, g = a === void 0 ? "anticon" : a, j = u.rootClassName, A = F(j, g, h(h({}, "".concat(g, "-").concat(r.name), !!r.name), "".concat(g, "-spin"), !!t || r.name === "loading"), e), p = l;
|
|
174
|
+
p === void 0 && s && (p = -1);
|
|
175
|
+
var P = i ? {
|
|
176
|
+
msTransform: "rotate(".concat(i, "deg)"),
|
|
177
|
+
transform: "rotate(".concat(i, "deg)")
|
|
178
|
+
} : void 0, B = E(y), w = R(B, 2), O = w[0], D = w[1];
|
|
179
|
+
return /* @__PURE__ */ f.createElement("span", G({
|
|
180
|
+
role: "img",
|
|
181
|
+
"aria-label": r.name
|
|
182
|
+
}, C, {
|
|
183
|
+
ref: o,
|
|
184
|
+
tabIndex: p,
|
|
185
|
+
onClick: s,
|
|
186
|
+
className: A
|
|
187
|
+
}), /* @__PURE__ */ f.createElement(d, {
|
|
188
|
+
icon: r,
|
|
189
|
+
primaryColor: O,
|
|
190
|
+
secondaryColor: D,
|
|
191
|
+
style: P
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
v.displayName = "AntdIcon";
|
|
195
|
+
v.getTwoToneColor = en;
|
|
196
|
+
v.setTwoToneColor = $;
|
|
197
|
+
export {
|
|
198
|
+
v as I,
|
|
199
|
+
M as g
|
|
200
|
+
};
|