@j2-health/design-system 0.3.2 → 0.4.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/README.md +53 -20
- package/dist/src/components/alert/Alert.cjs +12 -2
- package/dist/src/components/alert/Alert.cjs.map +1 -1
- package/dist/src/components/alert/Alert.d.ts +1 -1
- package/dist/src/components/alert/Alert.js +12 -2
- package/dist/src/components/alert/Alert.js.map +1 -1
- package/dist/src/components/alert/Alert.module.css.cjs +1 -1
- package/dist/src/components/alert/Alert.module.css.js +1 -1
- package/dist/src/components/card/Card.cjs +1 -1
- package/dist/src/components/card/Card.cjs.map +1 -1
- package/dist/src/components/card/Card.js +1 -1
- package/dist/src/components/card/Card.js.map +1 -1
- package/dist/src/components/collapse/Collapse.module.css.cjs +3 -3
- package/dist/src/components/collapse/Collapse.module.css.js +3 -3
- package/dist/src/components/drawer/Drawer.cjs +3 -1
- package/dist/src/components/drawer/Drawer.cjs.map +1 -1
- package/dist/src/components/drawer/Drawer.js +3 -1
- package/dist/src/components/drawer/Drawer.js.map +1 -1
- package/dist/src/components/form/Form.cjs +21 -4
- package/dist/src/components/form/Form.cjs.map +1 -1
- package/dist/src/components/form/Form.d.ts +10 -3
- package/dist/src/components/form/Form.js +20 -3
- package/dist/src/components/form/Form.js.map +1 -1
- package/dist/src/components/form/FormItem.cjs +42 -0
- package/dist/src/components/form/FormItem.cjs.map +1 -0
- package/dist/src/components/form/FormItem.d.ts +10 -0
- package/dist/src/components/form/FormItem.js +42 -0
- package/dist/src/components/form/FormItem.js.map +1 -0
- package/dist/src/components/form/FormItemFieldContext.cjs +8 -0
- package/dist/src/components/form/FormItemFieldContext.cjs.map +1 -0
- package/dist/src/components/form/FormItemFieldContext.d.ts +2 -0
- package/dist/src/components/form/FormItemFieldContext.js +8 -0
- package/dist/src/components/form/FormItemFieldContext.js.map +1 -0
- package/dist/src/components/form/FormikField.cjs +20 -0
- package/dist/src/components/form/FormikField.cjs.map +1 -0
- package/dist/src/components/form/FormikField.d.ts +8 -0
- package/dist/src/components/form/FormikField.js +20 -0
- package/dist/src/components/form/FormikField.js.map +1 -0
- package/dist/src/components/input/AntdInput.d.ts +72 -26
- package/dist/src/components/input/AntdSearchInput.d.ts +77 -25
- package/dist/src/components/input/Input.cjs +29 -3
- package/dist/src/components/input/Input.cjs.map +1 -1
- package/dist/src/components/input/Input.d.ts +4 -3
- package/dist/src/components/input/Input.js +29 -3
- package/dist/src/components/input/Input.js.map +1 -1
- package/dist/src/components/inputnumber/InputNumber.cjs +20 -5
- package/dist/src/components/inputnumber/InputNumber.cjs.map +1 -1
- package/dist/src/components/inputnumber/InputNumber.d.ts +4 -3
- package/dist/src/components/inputnumber/InputNumber.js +19 -4
- package/dist/src/components/inputnumber/InputNumber.js.map +1 -1
- package/dist/src/components/inputnumber/InputNumber.module.css.cjs +1 -1
- package/dist/src/components/inputnumber/InputNumber.module.css.js +1 -1
- package/dist/src/components/modal/Modal.cjs +0 -1
- package/dist/src/components/modal/Modal.cjs.map +1 -1
- package/dist/src/components/modal/Modal.js +0 -1
- package/dist/src/components/modal/Modal.js.map +1 -1
- package/dist/src/components/notification/Notification.module.css.cjs +1 -1
- package/dist/src/components/notification/Notification.module.css.js +1 -1
- package/dist/src/components/notification/useNotification.cjs +5 -2
- package/dist/src/components/notification/useNotification.cjs.map +1 -1
- package/dist/src/components/notification/useNotification.js +5 -2
- package/dist/src/components/notification/useNotification.js.map +1 -1
- package/dist/src/components/pagination/Pagination.cjs +2 -0
- package/dist/src/components/pagination/Pagination.cjs.map +1 -1
- package/dist/src/components/pagination/Pagination.js +2 -0
- package/dist/src/components/pagination/Pagination.js.map +1 -1
- package/dist/src/components/popover/Popover.cjs +3 -1
- package/dist/src/components/popover/Popover.cjs.map +1 -1
- package/dist/src/components/popover/Popover.d.ts +1 -1
- package/dist/src/components/popover/Popover.js +3 -1
- package/dist/src/components/popover/Popover.js.map +1 -1
- package/dist/src/components/popover/Popover.module.css.cjs +9 -9
- package/dist/src/components/popover/Popover.module.css.js +9 -9
- package/dist/src/components/select/Select.cjs +29 -13
- package/dist/src/components/select/Select.cjs.map +1 -1
- package/dist/src/components/select/Select.js +29 -13
- package/dist/src/components/select/Select.js.map +1 -1
- package/dist/src/components/select/SummarizedSelect.cjs.map +1 -1
- package/dist/src/components/select/SummarizedSelect.js.map +1 -1
- package/dist/src/components/select/SummarizedSelect.module.css.cjs +8 -8
- package/dist/src/components/select/SummarizedSelect.module.css.js +8 -8
- package/dist/src/components/steps/Steps.cjs +14 -4
- package/dist/src/components/steps/Steps.cjs.map +1 -1
- package/dist/src/components/steps/Steps.d.ts +3 -3
- package/dist/src/components/steps/Steps.js +14 -4
- package/dist/src/components/steps/Steps.js.map +1 -1
- package/dist/src/components/table/Table.cjs +1 -1
- package/dist/src/components/table/Table.cjs.map +1 -1
- package/dist/src/components/table/Table.d.ts +4 -1
- package/dist/src/components/table/Table.js +1 -1
- package/dist/src/components/table/Table.js.map +1 -1
- package/dist/src/components/tag/Tag.cjs +4 -0
- package/dist/src/components/tag/Tag.cjs.map +1 -1
- package/dist/src/components/tag/Tag.d.ts +1 -1
- package/dist/src/components/tag/Tag.js +4 -0
- package/dist/src/components/tag/Tag.js.map +1 -1
- package/dist/style.css +92 -78
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -107,29 +107,62 @@ the repo root; submodule consumers should alias `design-system` to that file
|
|
|
107
107
|
explicitly, since the package.json `exports` map points at `dist/`, which only
|
|
108
108
|
exists in the published package.
|
|
109
109
|
|
|
110
|
+
### Migrating to 0.4.0 (Ant Design 6)
|
|
111
|
+
|
|
112
|
+
Version 0.4.0 requires **antd ^6.6.3** and **@ant-design/icons ^6.3.4**. Upgrade
|
|
113
|
+
both with the design system; Ant Design 5 is no longer supported. React 18.3.1
|
|
114
|
+
and React 19 remain supported, and Tailwind stays on v3. Ant Design 6 requires
|
|
115
|
+
modern browsers with CSS-variable support.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install @j2-health/design-system@^0.4.0 antd@^6.6.3 @ant-design/icons@^6.3.4
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`formik-antd` is no longer a dependency: its published peer range excludes Ant
|
|
122
|
+
Design 6. The design system's `Form`, `Form.Item`, `Input`, `InputNumber`, and
|
|
123
|
+
`Select` now bind directly to Formik. Keep these components inside a `<Formik>`
|
|
124
|
+
provider. Nested field names, validation, touched state, submission, reset, and
|
|
125
|
+
field callbacks continue to use Formik.
|
|
126
|
+
|
|
127
|
+
If your application imports `formik-antd` directly, migrate those imports before
|
|
128
|
+
uninstalling it. Use the design-system exports for the components above; other
|
|
129
|
+
controls need an explicit Formik binding. `Form.Item` validation should use
|
|
130
|
+
Formik's `validate` or `validationSchema`, rather than antd's separate form
|
|
131
|
+
store and `rules` API.
|
|
132
|
+
|
|
133
|
+
Review direct antd imports and custom `.ant-*` CSS using the
|
|
134
|
+
[Ant Design 6 migration guide](https://ant.design/docs/react/migration-v6).
|
|
135
|
+
Several internal DOM classes changed. For types, derive step items from
|
|
136
|
+
`NonNullable<StepsProps['items']>[number]` instead of the removed `StepProps`
|
|
137
|
+
export. The design-system `Tag` retains its outlined default and trailing
|
|
138
|
+
spacing; raw antd tags follow the new v6 defaults.
|
|
139
|
+
|
|
110
140
|
### Local development against a consuming app
|
|
111
141
|
|
|
112
|
-
To work on a component and see it live in an app that depends on this package,
|
|
113
|
-
app's bundler at this checkout's source rather than linking the built
|
|
114
|
-
apps support this through a `DESIGN_SYSTEM_LOCAL` environment
|
|
142
|
+
To work on a component and see it live in an app that depends on this package,
|
|
143
|
+
point the app's bundler at this checkout's source rather than linking the built
|
|
144
|
+
package. Consuming apps support this through a `DESIGN_SYSTEM_LOCAL` environment
|
|
145
|
+
variable:
|
|
115
146
|
|
|
116
147
|
```bash
|
|
117
148
|
DESIGN_SYSTEM_LOCAL=/path/to/design-system npm run dev
|
|
118
149
|
```
|
|
119
150
|
|
|
120
|
-
**Do not use `npm link` or `npm install ../design-system`.** This package
|
|
121
|
-
dependencies that are also devDependencies, because Storybook and
|
|
122
|
-
to run. A linked install resolves those imports from
|
|
123
|
-
rather than the app's, so the app ends up
|
|
151
|
+
**Do not use `npm link` or `npm install ../design-system`.** This package
|
|
152
|
+
declares peer dependencies that are also devDependencies, because Storybook and
|
|
153
|
+
the test suite need them to run. A linked install resolves those imports from
|
|
154
|
+
this checkout's own `node_modules` rather than the app's, so the app ends up
|
|
155
|
+
with two copies of React and two copies of antd.
|
|
124
156
|
|
|
125
|
-
Two copies of React raise `Invalid hook call`, which is at least obvious. Two
|
|
126
|
-
fail silently: `AppConfigProvider` supplies the theme through
|
|
127
|
-
React context singleton, so a component resolved from
|
|
128
|
-
and renders unthemed with no error and no
|
|
129
|
-
|
|
157
|
+
Two copies of React raise `Invalid hook call`, which is at least obvious. Two
|
|
158
|
+
copies of antd fail silently: `AppConfigProvider` supplies the theme through
|
|
159
|
+
antd's `ConfigProvider`, a React context singleton, so a component resolved from
|
|
160
|
+
the second copy reads an empty context and renders unthemed with no error and no
|
|
161
|
+
warning. Because it only reproduces under a linked install, it looks like a bug
|
|
162
|
+
in this library that disappears the moment you publish.
|
|
130
163
|
|
|
131
|
-
Consuming apps must also set `resolve.dedupe` for `react`, `react-dom`, and
|
|
132
|
-
local checkout has its own `node_modules`.
|
|
164
|
+
Consuming apps must also set `resolve.dedupe` for `react`, `react-dom`, and
|
|
165
|
+
`antd`, since a local checkout has its own `node_modules`.
|
|
133
166
|
|
|
134
167
|
### Publishing to npm
|
|
135
168
|
|
|
@@ -144,9 +177,9 @@ consequences worth knowing before you change anything here:
|
|
|
144
177
|
- **Renaming or moving `publish-workflow.yml` breaks publishing.** The trusted
|
|
145
178
|
publisher is matched on the exact filename, case-sensitive. Update it on
|
|
146
179
|
npmjs.com in the same change.
|
|
147
|
-
- **Do not lower `.node-version` below 24.5.0.** Trusted publishing needs
|
|
148
|
-
|
|
149
|
-
|
|
180
|
+
- **Do not lower `.node-version` below 24.5.0.** Trusted publishing needs npm >=
|
|
181
|
+
11.5.1, which is exactly what Node 24.5.0 ships. The workflow asserts this
|
|
182
|
+
rather than letting it surface later as an unexplained 401.
|
|
150
183
|
|
|
151
184
|
To release a new version — maintainers only, since step 2 needs write access to
|
|
152
185
|
this repository:
|
|
@@ -160,7 +193,7 @@ $ gh workflow run publish-workflow.yml --ref main
|
|
|
160
193
|
```
|
|
161
194
|
|
|
162
195
|
Or, in the UI, **Actions → Publish to npm → Run workflow** with `main` selected.
|
|
163
|
-
Pick the ref carefully: the publish job is
|
|
196
|
+
Pick the ref carefully: the publish job is _skipped_ rather than failed on any
|
|
164
197
|
other ref, so a dispatch from a feature branch reports success without
|
|
165
198
|
publishing.
|
|
166
199
|
|
|
@@ -176,8 +209,8 @@ nowhere to push to.
|
|
|
176
209
|
Pushing a `v*` tag also triggers a release. Tag the remote `main` commit
|
|
177
210
|
explicitly: a bare `git tag` tags your current `HEAD`, and the workflow accepts
|
|
178
211
|
any tag ref, so a tag on an unmerged branch would publish that branch. Push the
|
|
179
|
-
tag explicitly too — `git push --follow-tags` silently skips lightweight tags
|
|
180
|
-
would report success without publishing:
|
|
212
|
+
tag explicitly too — `git push --follow-tags` silently skips lightweight tags
|
|
213
|
+
and would report success without publishing:
|
|
181
214
|
|
|
182
215
|
```bash
|
|
183
216
|
$ git fetch origin main
|
|
@@ -28,6 +28,12 @@ const Alert = ({
|
|
|
28
28
|
closable = false,
|
|
29
29
|
showIcon = true,
|
|
30
30
|
banner = false,
|
|
31
|
+
message,
|
|
32
|
+
title,
|
|
33
|
+
closeIcon,
|
|
34
|
+
closeText,
|
|
35
|
+
onClose,
|
|
36
|
+
afterClose,
|
|
31
37
|
...props
|
|
32
38
|
}) => {
|
|
33
39
|
const { token } = antd.theme.useToken();
|
|
@@ -81,12 +87,16 @@ const Alert = ({
|
|
|
81
87
|
{
|
|
82
88
|
className: Alert_module.default.alert,
|
|
83
89
|
icon,
|
|
84
|
-
closable
|
|
90
|
+
closable: closable || closeText ? {
|
|
91
|
+
closeIcon: closeText || (closeIcon ?? /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { size: token.size, weight: "regular" })),
|
|
92
|
+
onClose,
|
|
93
|
+
afterClose
|
|
94
|
+
} : false,
|
|
85
95
|
showIcon,
|
|
86
96
|
type: antDType,
|
|
87
97
|
banner,
|
|
88
98
|
description,
|
|
89
|
-
|
|
99
|
+
title: title ?? message,
|
|
90
100
|
...props
|
|
91
101
|
}
|
|
92
102
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.cjs","sources":["../../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Alert as AntdAlert, AlertProps, theme } from 'antd'\nimport {\n CheckCircleIcon,\n InfoIcon,\n WarningCircleIcon,\n XIcon,\n XCircleIcon,\n CircleNotchIcon,\n} from '@phosphor-icons/react'\nimport styles from './Alert.module.css'\ntype Props = Expand<Omit<AlertProps, 'type'>> & {\n description?: string\n type: 'success' | 'info' | 'warning' | 'error' | 'loading'\n closable?: boolean\n showIcon?: boolean\n banner?: boolean\n}\n\nconst Alert = ({\n description,\n type,\n closable = false,\n showIcon = true,\n banner = false,\n ...props\n}: Props) => {\n const { token } = theme.useToken()\n const icon = React.useMemo(() => {\n const size = description ? token.sizeLG : token.size\n const iconStyle = !description\n ? { display: 'flex', alignItems: 'center' }\n : undefined\n\n const iconElement = (() => {\n switch (type) {\n case 'success':\n return (\n <CheckCircleIcon fill=\"var(--j2-color-success-text)\" size={size} />\n )\n case 'error':\n return <XCircleIcon fill=\"var(--j2-color-error-text)\" size={size} />\n case 'info':\n return <InfoIcon fill=\"var(--j2-color-info-text)\" size={size} />\n case 'warning':\n return (\n <WarningCircleIcon\n fill=\"var(--j2-color-warning-text)\"\n size={size}\n />\n )\n case 'loading':\n return (\n <CircleNotchIcon\n fill=\"var(--j2-color-info-text)\"\n size={size}\n weight=\"regular\"\n style={{\n animation: 'spin 1s linear infinite',\n }}\n />\n )\n default:\n return null\n }\n })()\n\n return iconStyle ? (\n <span style={iconStyle}>{iconElement}</span>\n ) : (\n iconElement\n )\n }, [type, description, token.size, token.sizeLG])\n\n const antDType = React.useMemo(():\n 'success' | 'info' | 'warning' | 'error' => {\n switch (type) {\n case 'loading':\n return 'info'\n default:\n return type as 'success' | 'info' | 'warning' | 'error'\n }\n }, [type])\n\n return (\n <AntdAlert\n className={styles.alert}\n icon={icon}\n closable={closable}\n showIcon={showIcon}\n type={antDType}\n banner={banner}\n description={description}\n
|
|
1
|
+
{"version":3,"file":"Alert.cjs","sources":["../../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Alert as AntdAlert, AlertProps, theme } from 'antd'\nimport {\n CheckCircleIcon,\n InfoIcon,\n WarningCircleIcon,\n XIcon,\n XCircleIcon,\n CircleNotchIcon,\n} from '@phosphor-icons/react'\nimport styles from './Alert.module.css'\ntype Props = Expand<Omit<AlertProps, 'type'>> & {\n description?: string\n type: 'success' | 'info' | 'warning' | 'error' | 'loading'\n closable?: boolean\n showIcon?: boolean\n banner?: boolean\n}\n\nconst Alert = ({\n description,\n type,\n closable = false,\n showIcon = true,\n banner = false,\n message,\n title,\n closeIcon,\n closeText,\n onClose,\n afterClose,\n ...props\n}: Props) => {\n const { token } = theme.useToken()\n const icon = React.useMemo(() => {\n const size = description ? token.sizeLG : token.size\n const iconStyle = !description\n ? { display: 'flex', alignItems: 'center' }\n : undefined\n\n const iconElement = (() => {\n switch (type) {\n case 'success':\n return (\n <CheckCircleIcon fill=\"var(--j2-color-success-text)\" size={size} />\n )\n case 'error':\n return <XCircleIcon fill=\"var(--j2-color-error-text)\" size={size} />\n case 'info':\n return <InfoIcon fill=\"var(--j2-color-info-text)\" size={size} />\n case 'warning':\n return (\n <WarningCircleIcon\n fill=\"var(--j2-color-warning-text)\"\n size={size}\n />\n )\n case 'loading':\n return (\n <CircleNotchIcon\n fill=\"var(--j2-color-info-text)\"\n size={size}\n weight=\"regular\"\n style={{\n animation: 'spin 1s linear infinite',\n }}\n />\n )\n default:\n return null\n }\n })()\n\n return iconStyle ? (\n <span style={iconStyle}>{iconElement}</span>\n ) : (\n iconElement\n )\n }, [type, description, token.size, token.sizeLG])\n\n const antDType = React.useMemo(():\n 'success' | 'info' | 'warning' | 'error' => {\n switch (type) {\n case 'loading':\n return 'info'\n default:\n return type as 'success' | 'info' | 'warning' | 'error'\n }\n }, [type])\n\n return (\n <AntdAlert\n className={styles.alert}\n icon={icon}\n closable={\n closable || closeText\n ? {\n closeIcon:\n closeText ||\n (closeIcon ?? <XIcon size={token.size} weight=\"regular\" />),\n onClose,\n afterClose,\n }\n : false\n }\n showIcon={showIcon}\n type={antDType}\n banner={banner}\n description={description}\n title={title ?? message}\n {...props}\n />\n )\n}\n\nexport { Alert }\n"],"names":["theme","React","jsx","CheckCircleIcon","XCircleIcon","InfoIcon","WarningCircleIcon","CircleNotchIcon","AntdAlert","styles","XIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,QAAQ,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAa;AACX,QAAM,EAAE,MAAA,IAAUA,KAAAA,MAAM,SAAA;AACxB,QAAM,OAAOC,iBAAM,QAAQ,MAAM;AAC/B,UAAM,OAAO,cAAc,MAAM,SAAS,MAAM;AAChD,UAAM,YAAY,CAAC,cACf,EAAE,SAAS,QAAQ,YAAY,aAC/B;AAEJ,UAAM,eAAe,MAAM;AACzB,cAAQ,MAAA;AAAA,QACN,KAAK;AACH,iBACEC,2BAAAA,IAACC,MAAAA,iBAAA,EAAgB,MAAK,gCAA+B,KAAA,CAAY;AAAA,QAErE,KAAK;AACH,iBAAOD,2BAAAA,IAACE,MAAAA,aAAA,EAAY,MAAK,8BAA6B,KAAA,CAAY;AAAA,QACpE,KAAK;AACH,iBAAOF,2BAAAA,IAACG,MAAAA,UAAA,EAAS,MAAK,6BAA4B,KAAA,CAAY;AAAA,QAChE,KAAK;AACH,iBACEH,2BAAAA;AAAAA,YAACI,MAAAA;AAAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,YAAA;AAAA,UAAA;AAAA,QAGN,KAAK;AACH,iBACEJ,2BAAAA;AAAAA,YAACK,MAAAA;AAAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,cACA,QAAO;AAAA,cACP,OAAO;AAAA,gBACL,WAAW;AAAA,cAAA;AAAA,YACb;AAAA,UAAA;AAAA,QAGN;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAAA;AAEA,WAAO,YACLL,+BAAC,QAAA,EAAK,OAAO,WAAY,uBAAY,IAErC;AAAA,EAEJ,GAAG,CAAC,MAAM,aAAa,MAAM,MAAM,MAAM,MAAM,CAAC;AAEhD,QAAM,WAAWD,iBAAM,QAAQ,MACe;AAC5C,YAAQ,MAAA;AAAA,MACN,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAAA,EAEb,GAAG,CAAC,IAAI,CAAC;AAET,SACEC,2BAAAA;AAAAA,IAACM,KAAAA;AAAAA,IAAA;AAAA,MACC,WAAWC,aAAAA,QAAO;AAAA,MAClB;AAAA,MACA,UACE,YAAY,YACR;AAAA,QACE,WACE,cACC,aAAaP,2BAAAA,IAACQ,MAAAA,SAAM,MAAM,MAAM,MAAM,QAAO,UAAA,CAAU;AAAA,QAC1D;AAAA,QACA;AAAA,MAAA,IAEF;AAAA,MAEN;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MACf,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;;"}
|
|
@@ -7,5 +7,5 @@ type Props = Expand<Omit<AlertProps, 'type'>> & {
|
|
|
7
7
|
showIcon?: boolean;
|
|
8
8
|
banner?: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare const Alert: ({ description, type, closable, showIcon, banner, ...props }: Props) => React.JSX.Element;
|
|
10
|
+
declare const Alert: ({ description, type, closable, showIcon, banner, message, title, closeIcon, closeText, onClose, afterClose, ...props }: Props) => React.JSX.Element;
|
|
11
11
|
export { Alert };
|
|
@@ -9,6 +9,12 @@ const Alert = ({
|
|
|
9
9
|
closable = false,
|
|
10
10
|
showIcon = true,
|
|
11
11
|
banner = false,
|
|
12
|
+
message,
|
|
13
|
+
title,
|
|
14
|
+
closeIcon,
|
|
15
|
+
closeText,
|
|
16
|
+
onClose,
|
|
17
|
+
afterClose,
|
|
12
18
|
...props
|
|
13
19
|
}) => {
|
|
14
20
|
const { token } = theme.useToken();
|
|
@@ -62,12 +68,16 @@ const Alert = ({
|
|
|
62
68
|
{
|
|
63
69
|
className: styles.alert,
|
|
64
70
|
icon,
|
|
65
|
-
closable
|
|
71
|
+
closable: closable || closeText ? {
|
|
72
|
+
closeIcon: closeText || (closeIcon ?? /* @__PURE__ */ jsx(XIcon, { size: token.size, weight: "regular" })),
|
|
73
|
+
onClose,
|
|
74
|
+
afterClose
|
|
75
|
+
} : false,
|
|
66
76
|
showIcon,
|
|
67
77
|
type: antDType,
|
|
68
78
|
banner,
|
|
69
79
|
description,
|
|
70
|
-
|
|
80
|
+
title: title ?? message,
|
|
71
81
|
...props
|
|
72
82
|
}
|
|
73
83
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Alert as AntdAlert, AlertProps, theme } from 'antd'\nimport {\n CheckCircleIcon,\n InfoIcon,\n WarningCircleIcon,\n XIcon,\n XCircleIcon,\n CircleNotchIcon,\n} from '@phosphor-icons/react'\nimport styles from './Alert.module.css'\ntype Props = Expand<Omit<AlertProps, 'type'>> & {\n description?: string\n type: 'success' | 'info' | 'warning' | 'error' | 'loading'\n closable?: boolean\n showIcon?: boolean\n banner?: boolean\n}\n\nconst Alert = ({\n description,\n type,\n closable = false,\n showIcon = true,\n banner = false,\n ...props\n}: Props) => {\n const { token } = theme.useToken()\n const icon = React.useMemo(() => {\n const size = description ? token.sizeLG : token.size\n const iconStyle = !description\n ? { display: 'flex', alignItems: 'center' }\n : undefined\n\n const iconElement = (() => {\n switch (type) {\n case 'success':\n return (\n <CheckCircleIcon fill=\"var(--j2-color-success-text)\" size={size} />\n )\n case 'error':\n return <XCircleIcon fill=\"var(--j2-color-error-text)\" size={size} />\n case 'info':\n return <InfoIcon fill=\"var(--j2-color-info-text)\" size={size} />\n case 'warning':\n return (\n <WarningCircleIcon\n fill=\"var(--j2-color-warning-text)\"\n size={size}\n />\n )\n case 'loading':\n return (\n <CircleNotchIcon\n fill=\"var(--j2-color-info-text)\"\n size={size}\n weight=\"regular\"\n style={{\n animation: 'spin 1s linear infinite',\n }}\n />\n )\n default:\n return null\n }\n })()\n\n return iconStyle ? (\n <span style={iconStyle}>{iconElement}</span>\n ) : (\n iconElement\n )\n }, [type, description, token.size, token.sizeLG])\n\n const antDType = React.useMemo(():\n 'success' | 'info' | 'warning' | 'error' => {\n switch (type) {\n case 'loading':\n return 'info'\n default:\n return type as 'success' | 'info' | 'warning' | 'error'\n }\n }, [type])\n\n return (\n <AntdAlert\n className={styles.alert}\n icon={icon}\n closable={closable}\n showIcon={showIcon}\n type={antDType}\n banner={banner}\n description={description}\n
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/alert/Alert.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Alert as AntdAlert, AlertProps, theme } from 'antd'\nimport {\n CheckCircleIcon,\n InfoIcon,\n WarningCircleIcon,\n XIcon,\n XCircleIcon,\n CircleNotchIcon,\n} from '@phosphor-icons/react'\nimport styles from './Alert.module.css'\ntype Props = Expand<Omit<AlertProps, 'type'>> & {\n description?: string\n type: 'success' | 'info' | 'warning' | 'error' | 'loading'\n closable?: boolean\n showIcon?: boolean\n banner?: boolean\n}\n\nconst Alert = ({\n description,\n type,\n closable = false,\n showIcon = true,\n banner = false,\n message,\n title,\n closeIcon,\n closeText,\n onClose,\n afterClose,\n ...props\n}: Props) => {\n const { token } = theme.useToken()\n const icon = React.useMemo(() => {\n const size = description ? token.sizeLG : token.size\n const iconStyle = !description\n ? { display: 'flex', alignItems: 'center' }\n : undefined\n\n const iconElement = (() => {\n switch (type) {\n case 'success':\n return (\n <CheckCircleIcon fill=\"var(--j2-color-success-text)\" size={size} />\n )\n case 'error':\n return <XCircleIcon fill=\"var(--j2-color-error-text)\" size={size} />\n case 'info':\n return <InfoIcon fill=\"var(--j2-color-info-text)\" size={size} />\n case 'warning':\n return (\n <WarningCircleIcon\n fill=\"var(--j2-color-warning-text)\"\n size={size}\n />\n )\n case 'loading':\n return (\n <CircleNotchIcon\n fill=\"var(--j2-color-info-text)\"\n size={size}\n weight=\"regular\"\n style={{\n animation: 'spin 1s linear infinite',\n }}\n />\n )\n default:\n return null\n }\n })()\n\n return iconStyle ? (\n <span style={iconStyle}>{iconElement}</span>\n ) : (\n iconElement\n )\n }, [type, description, token.size, token.sizeLG])\n\n const antDType = React.useMemo(():\n 'success' | 'info' | 'warning' | 'error' => {\n switch (type) {\n case 'loading':\n return 'info'\n default:\n return type as 'success' | 'info' | 'warning' | 'error'\n }\n }, [type])\n\n return (\n <AntdAlert\n className={styles.alert}\n icon={icon}\n closable={\n closable || closeText\n ? {\n closeIcon:\n closeText ||\n (closeIcon ?? <XIcon size={token.size} weight=\"regular\" />),\n onClose,\n afterClose,\n }\n : false\n }\n showIcon={showIcon}\n type={antDType}\n banner={banner}\n description={description}\n title={title ?? message}\n {...props}\n />\n )\n}\n\nexport { Alert }\n"],"names":["AntdAlert"],"mappings":";;;;;AAmBA,MAAM,QAAQ,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAa;AACX,QAAM,EAAE,MAAA,IAAU,MAAM,SAAA;AACxB,QAAM,OAAO,MAAM,QAAQ,MAAM;AAC/B,UAAM,OAAO,cAAc,MAAM,SAAS,MAAM;AAChD,UAAM,YAAY,CAAC,cACf,EAAE,SAAS,QAAQ,YAAY,aAC/B;AAEJ,UAAM,eAAe,MAAM;AACzB,cAAQ,MAAA;AAAA,QACN,KAAK;AACH,iBACE,oBAAC,iBAAA,EAAgB,MAAK,gCAA+B,KAAA,CAAY;AAAA,QAErE,KAAK;AACH,iBAAO,oBAAC,aAAA,EAAY,MAAK,8BAA6B,KAAA,CAAY;AAAA,QACpE,KAAK;AACH,iBAAO,oBAAC,UAAA,EAAS,MAAK,6BAA4B,KAAA,CAAY;AAAA,QAChE,KAAK;AACH,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,YAAA;AAAA,UAAA;AAAA,QAGN,KAAK;AACH,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,cACA,QAAO;AAAA,cACP,OAAO;AAAA,gBACL,WAAW;AAAA,cAAA;AAAA,YACb;AAAA,UAAA;AAAA,QAGN;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAAA;AAEA,WAAO,YACL,oBAAC,QAAA,EAAK,OAAO,WAAY,uBAAY,IAErC;AAAA,EAEJ,GAAG,CAAC,MAAM,aAAa,MAAM,MAAM,MAAM,MAAM,CAAC;AAEhD,QAAM,WAAW,MAAM,QAAQ,MACe;AAC5C,YAAQ,MAAA;AAAA,MACN,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAAA,EAEb,GAAG,CAAC,IAAI,CAAC;AAET,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC,WAAW,OAAO;AAAA,MAClB;AAAA,MACA,UACE,YAAY,YACR;AAAA,QACE,WACE,cACC,aAAa,oBAAC,SAAM,MAAM,MAAM,MAAM,QAAO,UAAA,CAAU;AAAA,QAC1D;AAAA,QACA;AAAA,MAAA,IAEF;AAAA,MAEN;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MACf,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.cjs","sources":["../../../../src/components/card/Card.tsx"],"sourcesContent":["import { Card as AntdCard, CardProps } from 'antd'\nimport cx from 'classnames'\n\n// import this file to enable styling defined in there\nimport './Card.css'\n\nexport type Props = Omit<CardProps, 'size'> & {\n /** Card title */\n title?: string\n /** Card contents */\n children: React.ReactNode\n /** Loading state */\n loading?: boolean\n /** Card size */\n size?: 'default' | 'small' | 'compact' | 'large'\n /**\n * Inner card type variant.\n * It allows inner card to have variants independent of other props.\n * Works only with type=\"inner\".\n */\n innerVariant?: 'default' | 'basic'\n}\n\nconst Card = ({\n title,\n children,\n loading,\n size = 'default',\n innerVariant = 'default',\n className,\n ...props\n}: Props) => {\n const isInner = props.type === 'inner'\n const isInnerBasic = isInner && innerVariant === 'basic'\n return (\n <AntdCard\n className={cx(\n 'j2-card',\n `j2-card-${size}`,\n isInnerBasic && 'inner-basic',\n className\n )}\n {...props}\n size={size === '
|
|
1
|
+
{"version":3,"file":"Card.cjs","sources":["../../../../src/components/card/Card.tsx"],"sourcesContent":["import { Card as AntdCard, CardProps } from 'antd'\nimport cx from 'classnames'\n\n// import this file to enable styling defined in there\nimport './Card.css'\n\nexport type Props = Omit<CardProps, 'size'> & {\n /** Card title */\n title?: string\n /** Card contents */\n children: React.ReactNode\n /** Loading state */\n loading?: boolean\n /** Card size */\n size?: 'default' | 'small' | 'compact' | 'large'\n /**\n * Inner card type variant.\n * It allows inner card to have variants independent of other props.\n * Works only with type=\"inner\".\n */\n innerVariant?: 'default' | 'basic'\n}\n\nconst Card = ({\n title,\n children,\n loading,\n size = 'default',\n innerVariant = 'default',\n className,\n ...props\n}: Props) => {\n const isInner = props.type === 'inner'\n const isInnerBasic = isInner && innerVariant === 'basic'\n return (\n <AntdCard\n className={cx(\n 'j2-card',\n `j2-card-${size}`,\n isInnerBasic && 'inner-basic',\n className\n )}\n {...props}\n size={size === 'small' ? 'small' : 'medium'}\n title={title}\n loading={loading}\n >\n {children}\n </AntdCard>\n )\n}\n\nexport { Card }\n"],"names":["jsx","AntdCard"],"mappings":";;;;;;AAuBA,MAAM,OAAO,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,MAAa;AACX,QAAM,UAAU,MAAM,SAAS;AAC/B,QAAM,eAAe,WAAW,iBAAiB;AACjD,SACEA,2BAAAA;AAAAA,IAACC,KAAAA;AAAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,WAAW,IAAI;AAAA,QACf,gBAAgB;AAAA,QAChB;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MACJ,MAAM,SAAS,UAAU,UAAU;AAAA,MACnC;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../../src/components/card/Card.tsx"],"sourcesContent":["import { Card as AntdCard, CardProps } from 'antd'\nimport cx from 'classnames'\n\n// import this file to enable styling defined in there\nimport './Card.css'\n\nexport type Props = Omit<CardProps, 'size'> & {\n /** Card title */\n title?: string\n /** Card contents */\n children: React.ReactNode\n /** Loading state */\n loading?: boolean\n /** Card size */\n size?: 'default' | 'small' | 'compact' | 'large'\n /**\n * Inner card type variant.\n * It allows inner card to have variants independent of other props.\n * Works only with type=\"inner\".\n */\n innerVariant?: 'default' | 'basic'\n}\n\nconst Card = ({\n title,\n children,\n loading,\n size = 'default',\n innerVariant = 'default',\n className,\n ...props\n}: Props) => {\n const isInner = props.type === 'inner'\n const isInnerBasic = isInner && innerVariant === 'basic'\n return (\n <AntdCard\n className={cx(\n 'j2-card',\n `j2-card-${size}`,\n isInnerBasic && 'inner-basic',\n className\n )}\n {...props}\n size={size === '
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../src/components/card/Card.tsx"],"sourcesContent":["import { Card as AntdCard, CardProps } from 'antd'\nimport cx from 'classnames'\n\n// import this file to enable styling defined in there\nimport './Card.css'\n\nexport type Props = Omit<CardProps, 'size'> & {\n /** Card title */\n title?: string\n /** Card contents */\n children: React.ReactNode\n /** Loading state */\n loading?: boolean\n /** Card size */\n size?: 'default' | 'small' | 'compact' | 'large'\n /**\n * Inner card type variant.\n * It allows inner card to have variants independent of other props.\n * Works only with type=\"inner\".\n */\n innerVariant?: 'default' | 'basic'\n}\n\nconst Card = ({\n title,\n children,\n loading,\n size = 'default',\n innerVariant = 'default',\n className,\n ...props\n}: Props) => {\n const isInner = props.type === 'inner'\n const isInnerBasic = isInner && innerVariant === 'basic'\n return (\n <AntdCard\n className={cx(\n 'j2-card',\n `j2-card-${size}`,\n isInnerBasic && 'inner-basic',\n className\n )}\n {...props}\n size={size === 'small' ? 'small' : 'medium'}\n title={title}\n loading={loading}\n >\n {children}\n </AntdCard>\n )\n}\n\nexport { Card }\n"],"names":["AntdCard"],"mappings":";;;;AAuBA,MAAM,OAAO,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,MAAa;AACX,QAAM,UAAU,MAAM,SAAS;AAC/B,QAAM,eAAe,WAAW,iBAAiB;AACjD,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,WAAW,IAAI;AAAA,QACf,gBAAgB;AAAA,QAChB;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MACJ,MAAM,SAAS,UAAU,UAAU;AAAA,MACnC;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const warning = "
|
|
4
|
-
const error = "
|
|
3
|
+
const warning = "_warning_1t61q_2";
|
|
4
|
+
const error = "_error_1t61q_3";
|
|
5
5
|
const styles = {
|
|
6
|
-
"default": "
|
|
6
|
+
"default": "_default_1t61q_1",
|
|
7
7
|
warning,
|
|
8
8
|
error
|
|
9
9
|
};
|
|
@@ -16,7 +16,9 @@ const Drawer = ({
|
|
|
16
16
|
{
|
|
17
17
|
...props,
|
|
18
18
|
closable: false,
|
|
19
|
-
...fillPage && {
|
|
19
|
+
...fillPage && {
|
|
20
|
+
size: props.placement === "top" || props.placement === "bottom" ? "100vh" : "100vw"
|
|
21
|
+
},
|
|
20
22
|
...footer && { footer },
|
|
21
23
|
extra: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
22
24
|
extraContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.cjs","sources":["../../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as AntdDrawer, DrawerProps, Space } from 'antd'\nimport { Button } from '../button'\nimport { XIcon } from '@phosphor-icons/react'\nimport './Drawer.css'\n\ntype AllProps = Omit<DrawerProps, 'extra' | 'closable'> & {\n fillPage?: boolean\n footer?: React.ReactNode\n extraContent?: React.ReactNode\n}\n\nexport type Props = Expand<AllProps>\n\nexport const Drawer = ({\n fillPage = false,\n footer,\n extraContent,\n ...props\n}: Props) => {\n return (\n <AntdDrawer\n {...props}\n closable={false}\n {...(fillPage && {
|
|
1
|
+
{"version":3,"file":"Drawer.cjs","sources":["../../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as AntdDrawer, DrawerProps, Space } from 'antd'\nimport { Button } from '../button'\nimport { XIcon } from '@phosphor-icons/react'\nimport './Drawer.css'\n\ntype AllProps = Omit<DrawerProps, 'extra' | 'closable'> & {\n fillPage?: boolean\n footer?: React.ReactNode\n extraContent?: React.ReactNode\n}\n\nexport type Props = Expand<AllProps>\n\nexport const Drawer = ({\n fillPage = false,\n footer,\n extraContent,\n ...props\n}: Props) => {\n return (\n <AntdDrawer\n {...props}\n closable={false}\n {...(fillPage && {\n size:\n props.placement === 'top' || props.placement === 'bottom'\n ? '100vh'\n : '100vw',\n })}\n {...(footer && { footer })}\n extra={\n <Space>\n {extraContent}\n <Button\n className=\"p-0\"\n type=\"link\"\n onClick={props.onClose}\n aria-label=\"Close\"\n >\n <XIcon size={22} weight=\"regular\" />\n </Button>\n </Space>\n }\n className=\"j2-drawer\"\n />\n )\n}\n"],"names":["jsx","AntdDrawer","Space","Button","XIcon"],"mappings":";;;;;;;AAaO,MAAM,SAAS,CAAC;AAAA,EACrB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAa;AACX,SACEA,2BAAAA;AAAAA,IAACC,KAAAA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACT,GAAI,YAAY;AAAA,QACf,MACE,MAAM,cAAc,SAAS,MAAM,cAAc,WAC7C,UACA;AAAA,MAAA;AAAA,MAEP,GAAI,UAAU,EAAE,OAAA;AAAA,MACjB,uCACGC,YAAA,EACE,UAAA;AAAA,QAAA;AAAA,QACDF,2BAAAA;AAAAA,UAACG,OAAAA;AAAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,SAAS,MAAM;AAAA,YACf,cAAW;AAAA,YAEX,UAAAH,2BAAAA,IAACI,aAAA,EAAM,MAAM,IAAI,QAAO,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACpC,GACF;AAAA,MAEF,WAAU;AAAA,IAAA;AAAA,EAAA;AAGhB;;"}
|
|
@@ -14,7 +14,9 @@ const Drawer = ({
|
|
|
14
14
|
{
|
|
15
15
|
...props,
|
|
16
16
|
closable: false,
|
|
17
|
-
...fillPage && {
|
|
17
|
+
...fillPage && {
|
|
18
|
+
size: props.placement === "top" || props.placement === "bottom" ? "100vh" : "100vw"
|
|
19
|
+
},
|
|
18
20
|
...footer && { footer },
|
|
19
21
|
extra: /* @__PURE__ */ jsxs(Space, { children: [
|
|
20
22
|
extraContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as AntdDrawer, DrawerProps, Space } from 'antd'\nimport { Button } from '../button'\nimport { XIcon } from '@phosphor-icons/react'\nimport './Drawer.css'\n\ntype AllProps = Omit<DrawerProps, 'extra' | 'closable'> & {\n fillPage?: boolean\n footer?: React.ReactNode\n extraContent?: React.ReactNode\n}\n\nexport type Props = Expand<AllProps>\n\nexport const Drawer = ({\n fillPage = false,\n footer,\n extraContent,\n ...props\n}: Props) => {\n return (\n <AntdDrawer\n {...props}\n closable={false}\n {...(fillPage && {
|
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as AntdDrawer, DrawerProps, Space } from 'antd'\nimport { Button } from '../button'\nimport { XIcon } from '@phosphor-icons/react'\nimport './Drawer.css'\n\ntype AllProps = Omit<DrawerProps, 'extra' | 'closable'> & {\n fillPage?: boolean\n footer?: React.ReactNode\n extraContent?: React.ReactNode\n}\n\nexport type Props = Expand<AllProps>\n\nexport const Drawer = ({\n fillPage = false,\n footer,\n extraContent,\n ...props\n}: Props) => {\n return (\n <AntdDrawer\n {...props}\n closable={false}\n {...(fillPage && {\n size:\n props.placement === 'top' || props.placement === 'bottom'\n ? '100vh'\n : '100vw',\n })}\n {...(footer && { footer })}\n extra={\n <Space>\n {extraContent}\n <Button\n className=\"p-0\"\n type=\"link\"\n onClick={props.onClose}\n aria-label=\"Close\"\n >\n <XIcon size={22} weight=\"regular\" />\n </Button>\n </Space>\n }\n className=\"j2-drawer\"\n />\n )\n}\n"],"names":["AntdDrawer"],"mappings":";;;;;AAaO,MAAM,SAAS,CAAC;AAAA,EACrB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAa;AACX,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACT,GAAI,YAAY;AAAA,QACf,MACE,MAAM,cAAc,SAAS,MAAM,cAAc,WAC7C,UACA;AAAA,MAAA;AAAA,MAEP,GAAI,UAAU,EAAE,OAAA;AAAA,MACjB,4BACG,OAAA,EACE,UAAA;AAAA,QAAA;AAAA,QACD;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,SAAS,MAAM;AAAA,YACf,cAAW;AAAA,YAEX,UAAA,oBAAC,OAAA,EAAM,MAAM,IAAI,QAAO,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACpC,GACF;AAAA,MAEF,WAAU;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const antd = require("antd");
|
|
5
|
+
const formik = require("formik");
|
|
6
|
+
const FormItem = require("./FormItem.cjs");
|
|
5
7
|
;/* empty css */
|
|
6
|
-
const Form = ({ children, ...props }) => {
|
|
7
|
-
|
|
8
|
+
const Form = ({ children, onFinish, onReset, ...props }) => {
|
|
9
|
+
const { handleSubmit, handleReset } = formik.useFormikContext();
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
antd.Form,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
onFinish: (values) => {
|
|
15
|
+
handleSubmit();
|
|
16
|
+
onFinish == null ? void 0 : onFinish(values);
|
|
17
|
+
},
|
|
18
|
+
onReset: (event) => {
|
|
19
|
+
handleReset(event);
|
|
20
|
+
onReset == null ? void 0 : onReset(event);
|
|
21
|
+
},
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
8
25
|
};
|
|
9
|
-
Form.Item =
|
|
26
|
+
Form.Item = FormItem.FormItem;
|
|
10
27
|
exports.Form = Form;
|
|
11
28
|
//# sourceMappingURL=Form.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.cjs","sources":["../../../../src/components/form/Form.tsx"],"sourcesContent":["import { FormProps } from 'antd'\nimport {
|
|
1
|
+
{"version":3,"file":"Form.cjs","sources":["../../../../src/components/form/Form.tsx"],"sourcesContent":["import { Form as AntdForm, type FormProps } from 'antd'\nimport { useFormikContext } from 'formik'\nimport type { ReactNode } from 'react'\nimport { FormItem } from './FormItem'\nimport './Form.css'\n\ntype Props = Expand<Omit<FormProps, 'children'> & { children?: ReactNode }>\n\nexport const Form = ({ children, onFinish, onReset, ...props }: Props) => {\n const { handleSubmit, handleReset } = useFormikContext()\n return (\n <AntdForm\n {...props}\n onFinish={(values) => {\n handleSubmit()\n onFinish?.(values)\n }}\n onReset={(event) => {\n handleReset(event)\n onReset?.(event)\n }}\n >\n {children}\n </AntdForm>\n )\n}\n\nForm.Item = FormItem\n"],"names":["useFormikContext","jsx","AntdForm","FormItem"],"mappings":";;;;;;;AAQO,MAAM,OAAO,CAAC,EAAE,UAAU,UAAU,SAAS,GAAG,YAAmB;AACxE,QAAM,EAAE,cAAc,YAAA,IAAgBA,wBAAA;AACtC,SACEC,2BAAAA;AAAAA,IAACC,KAAAA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,CAAC,WAAW;AACpB,qBAAA;AACA,6CAAW;AAAA,MACb;AAAA,MACA,SAAS,CAAC,UAAU;AAClB,oBAAY,KAAK;AACjB,2CAAU;AAAA,MACZ;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEA,KAAK,OAAOC,SAAAA;;"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
|
-
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type Props = Expand<Omit<FormProps, 'children'> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}>;
|
|
3
6
|
export declare const Form: {
|
|
4
|
-
({ children, ...props }: Props): import("react").JSX.Element;
|
|
5
|
-
Item: ({ name,
|
|
7
|
+
({ children, onFinish, onReset, ...props }: Props): import("react").JSX.Element;
|
|
8
|
+
Item: ({ name, validate, children, showValidateSuccess, showInitialErrorAfterTouched, ...props }: Omit<import('antd').FormItemProps<any>, "children" | "name"> & Pick<import('./FormikField.js').FormikFieldProps, "name" | "validate"> & {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
showValidateSuccess?: boolean;
|
|
11
|
+
showInitialErrorAfterTouched?: boolean;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
6
13
|
};
|
|
7
14
|
export {};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Form as Form$1
|
|
2
|
+
import { Form as Form$1 } from "antd";
|
|
3
|
+
import { useFormikContext } from "formik";
|
|
4
|
+
import { FormItem } from "./FormItem.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
const Form = ({ children, ...props }) => {
|
|
5
|
-
|
|
6
|
+
const Form = ({ children, onFinish, onReset, ...props }) => {
|
|
7
|
+
const { handleSubmit, handleReset } = useFormikContext();
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Form$1,
|
|
10
|
+
{
|
|
11
|
+
...props,
|
|
12
|
+
onFinish: (values) => {
|
|
13
|
+
handleSubmit();
|
|
14
|
+
onFinish == null ? void 0 : onFinish(values);
|
|
15
|
+
},
|
|
16
|
+
onReset: (event) => {
|
|
17
|
+
handleReset(event);
|
|
18
|
+
onReset == null ? void 0 : onReset(event);
|
|
19
|
+
},
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
6
23
|
};
|
|
7
24
|
Form.Item = FormItem;
|
|
8
25
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../src/components/form/Form.tsx"],"sourcesContent":["import { FormProps } from 'antd'\nimport {
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../src/components/form/Form.tsx"],"sourcesContent":["import { Form as AntdForm, type FormProps } from 'antd'\nimport { useFormikContext } from 'formik'\nimport type { ReactNode } from 'react'\nimport { FormItem } from './FormItem'\nimport './Form.css'\n\ntype Props = Expand<Omit<FormProps, 'children'> & { children?: ReactNode }>\n\nexport const Form = ({ children, onFinish, onReset, ...props }: Props) => {\n const { handleSubmit, handleReset } = useFormikContext()\n return (\n <AntdForm\n {...props}\n onFinish={(values) => {\n handleSubmit()\n onFinish?.(values)\n }}\n onReset={(event) => {\n handleReset(event)\n onReset?.(event)\n }}\n >\n {children}\n </AntdForm>\n )\n}\n\nForm.Item = FormItem\n"],"names":["AntdForm"],"mappings":";;;;;AAQO,MAAM,OAAO,CAAC,EAAE,UAAU,UAAU,SAAS,GAAG,YAAmB;AACxE,QAAM,EAAE,cAAc,YAAA,IAAgB,iBAAA;AACtC,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,CAAC,WAAW;AACpB,qBAAA;AACA,6CAAW;AAAA,MACb;AAAA,MACA,SAAS,CAAC,UAAU;AAClB,oBAAY,KAAK;AACjB,2CAAU;AAAA,MACZ;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEA,KAAK,OAAO;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const antd = require("antd");
|
|
5
|
+
const formik = require("formik");
|
|
6
|
+
const FormikField = require("./FormikField.cjs");
|
|
7
|
+
const FormItemFieldContext = require("./FormItemFieldContext.cjs");
|
|
8
|
+
const FormItem = ({
|
|
9
|
+
name,
|
|
10
|
+
validate,
|
|
11
|
+
children,
|
|
12
|
+
showValidateSuccess,
|
|
13
|
+
showInitialErrorAfterTouched = false,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const form = formik.useFormikContext();
|
|
17
|
+
const error = formik.getIn(form.errors, name);
|
|
18
|
+
const initialError = formik.getIn(form.initialErrors, name);
|
|
19
|
+
const touched = formik.getIn(form.touched, name, false);
|
|
20
|
+
const isTouched = Array.isArray(touched) ? touched.length === 0 || touched.some(Boolean) : touched;
|
|
21
|
+
const hasError = error !== void 0 && isTouched;
|
|
22
|
+
const showInitialError = initialError !== void 0 && (!isTouched || showInitialErrorAfterTouched);
|
|
23
|
+
const isValid = !error && isTouched;
|
|
24
|
+
const item = /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
antd.Form.Item,
|
|
26
|
+
{
|
|
27
|
+
htmlFor: name,
|
|
28
|
+
id: name,
|
|
29
|
+
validateStatus: hasError || initialError !== void 0 && !isTouched ? "error" : isValid && showValidateSuccess ? "success" : void 0,
|
|
30
|
+
hasFeedback: isValid,
|
|
31
|
+
help: hasError || showInitialError ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
32
|
+
hasError && /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }),
|
|
33
|
+
showInitialError && /* @__PURE__ */ jsxRuntime.jsx("li", { children: initialError })
|
|
34
|
+
] }) : null,
|
|
35
|
+
...props,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
return validate ? /* @__PURE__ */ jsxRuntime.jsx(FormikField.FormikField, { name, validate, children: (fieldProps) => /* @__PURE__ */ jsxRuntime.jsx(FormItemFieldContext.FormItemFieldContext.Provider, { value: fieldProps, children: item }) }) : item;
|
|
40
|
+
};
|
|
41
|
+
exports.FormItem = FormItem;
|
|
42
|
+
//# sourceMappingURL=FormItem.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormItem.cjs","sources":["../../../../src/components/form/FormItem.tsx"],"sourcesContent":["import { Form as AntdForm, type FormItemProps as AntdFormItemProps } from 'antd'\nimport { getIn, useFormikContext } from 'formik'\nimport type { ReactNode } from 'react'\nimport { FormikField, type FormikFieldProps } from './FormikField'\nimport { FormItemFieldContext } from './FormItemFieldContext'\n\ntype Props = Omit<AntdFormItemProps, 'name' | 'children'> &\n Pick<FormikFieldProps, 'name' | 'validate'> & {\n children: ReactNode\n showValidateSuccess?: boolean\n showInitialErrorAfterTouched?: boolean\n }\n\nexport const FormItem = ({\n name,\n validate,\n children,\n showValidateSuccess,\n showInitialErrorAfterTouched = false,\n ...props\n}: Props) => {\n const form = useFormikContext()\n const error = getIn(form.errors, name)\n const initialError = getIn(form.initialErrors, name)\n const touched = getIn(form.touched, name, false)\n const isTouched = Array.isArray(touched)\n ? touched.length === 0 || touched.some(Boolean)\n : touched\n const hasError = error !== undefined && isTouched\n const showInitialError =\n initialError !== undefined && (!isTouched || showInitialErrorAfterTouched)\n const isValid = !error && isTouched\n\n const item = (\n <AntdForm.Item\n htmlFor={name}\n id={name}\n validateStatus={\n hasError || (initialError !== undefined && !isTouched)\n ? 'error'\n : isValid && showValidateSuccess\n ? 'success'\n : undefined\n }\n hasFeedback={isValid}\n help={\n hasError || showInitialError ? (\n <>\n {hasError && <li>{error}</li>}\n {showInitialError && <li>{initialError}</li>}\n </>\n ) : null\n }\n {...props}\n >\n {/* Formik owns values and validation; do not register an antd field. */}\n {children}\n </AntdForm.Item>\n )\n // Display-only items must not register a second field over their control.\n // When validate is supplied, the item owns validation (as before).\n return validate ? (\n <FormikField name={name} validate={validate}>\n {(fieldProps) => (\n <FormItemFieldContext.Provider value={fieldProps}>\n {item}\n </FormItemFieldContext.Provider>\n )}\n </FormikField>\n ) : (\n item\n )\n}\n"],"names":["useFormikContext","getIn","jsx","AntdForm","jsxs","Fragment","FormikField","FormItemFieldContext"],"mappings":";;;;;;;AAaO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,+BAA+B;AAAA,EAC/B,GAAG;AACL,MAAa;AACX,QAAM,OAAOA,OAAAA,iBAAA;AACb,QAAM,QAAQC,OAAAA,MAAM,KAAK,QAAQ,IAAI;AACrC,QAAM,eAAeA,OAAAA,MAAM,KAAK,eAAe,IAAI;AACnD,QAAM,UAAUA,OAAAA,MAAM,KAAK,SAAS,MAAM,KAAK;AAC/C,QAAM,YAAY,MAAM,QAAQ,OAAO,IACnC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO,IAC5C;AACJ,QAAM,WAAW,UAAU,UAAa;AACxC,QAAM,mBACJ,iBAAiB,WAAc,CAAC,aAAa;AAC/C,QAAM,UAAU,CAAC,SAAS;AAE1B,QAAM,OACJC,2BAAAA;AAAAA,IAACC,KAAAA,KAAS;AAAA,IAAT;AAAA,MACC,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,gBACE,YAAa,iBAAiB,UAAa,CAAC,YACxC,UACA,WAAW,sBACT,YACA;AAAA,MAER,aAAa;AAAA,MACb,MACE,YAAY,mBACVC,2BAAAA,KAAAC,WAAAA,UAAA,EACG,UAAA;AAAA,QAAA,YAAYH,2BAAAA,IAAC,QAAI,UAAA,MAAA,CAAM;AAAA,QACvB,oBAAoBA,2BAAAA,IAAC,MAAA,EAAI,UAAA,aAAA,CAAa;AAAA,MAAA,EAAA,CACzC,IACE;AAAA,MAEL,GAAG;AAAA,MAGH;AAAA,IAAA;AAAA,EAAA;AAKL,SAAO,WACLA,2BAAAA,IAACI,yBAAA,EAAY,MAAY,UACtB,UAAA,CAAC,eACAJ,2BAAAA,IAACK,qBAAAA,qBAAqB,UAArB,EAA8B,OAAO,YACnC,UAAA,KAAA,CACH,GAEJ,IAEA;AAEJ;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormItemProps as AntdFormItemProps } from 'antd';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { FormikFieldProps } from './FormikField.js';
|
|
4
|
+
type Props = Omit<AntdFormItemProps, 'name' | 'children'> & Pick<FormikFieldProps, 'name' | 'validate'> & {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
showValidateSuccess?: boolean;
|
|
7
|
+
showInitialErrorAfterTouched?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormItem: ({ name, validate, children, showValidateSuccess, showInitialErrorAfterTouched, ...props }: Props) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from "antd";
|
|
3
|
+
import { useFormikContext, getIn } from "formik";
|
|
4
|
+
import { FormikField } from "./FormikField.js";
|
|
5
|
+
import { FormItemFieldContext } from "./FormItemFieldContext.js";
|
|
6
|
+
const FormItem = ({
|
|
7
|
+
name,
|
|
8
|
+
validate,
|
|
9
|
+
children,
|
|
10
|
+
showValidateSuccess,
|
|
11
|
+
showInitialErrorAfterTouched = false,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
const form = useFormikContext();
|
|
15
|
+
const error = getIn(form.errors, name);
|
|
16
|
+
const initialError = getIn(form.initialErrors, name);
|
|
17
|
+
const touched = getIn(form.touched, name, false);
|
|
18
|
+
const isTouched = Array.isArray(touched) ? touched.length === 0 || touched.some(Boolean) : touched;
|
|
19
|
+
const hasError = error !== void 0 && isTouched;
|
|
20
|
+
const showInitialError = initialError !== void 0 && (!isTouched || showInitialErrorAfterTouched);
|
|
21
|
+
const isValid = !error && isTouched;
|
|
22
|
+
const item = /* @__PURE__ */ jsx(
|
|
23
|
+
Form.Item,
|
|
24
|
+
{
|
|
25
|
+
htmlFor: name,
|
|
26
|
+
id: name,
|
|
27
|
+
validateStatus: hasError || initialError !== void 0 && !isTouched ? "error" : isValid && showValidateSuccess ? "success" : void 0,
|
|
28
|
+
hasFeedback: isValid,
|
|
29
|
+
help: hasError || showInitialError ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
hasError && /* @__PURE__ */ jsx("li", { children: error }),
|
|
31
|
+
showInitialError && /* @__PURE__ */ jsx("li", { children: initialError })
|
|
32
|
+
] }) : null,
|
|
33
|
+
...props,
|
|
34
|
+
children
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
return validate ? /* @__PURE__ */ jsx(FormikField, { name, validate, children: (fieldProps) => /* @__PURE__ */ jsx(FormItemFieldContext.Provider, { value: fieldProps, children: item }) }) : item;
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
FormItem
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=FormItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormItem.js","sources":["../../../../src/components/form/FormItem.tsx"],"sourcesContent":["import { Form as AntdForm, type FormItemProps as AntdFormItemProps } from 'antd'\nimport { getIn, useFormikContext } from 'formik'\nimport type { ReactNode } from 'react'\nimport { FormikField, type FormikFieldProps } from './FormikField'\nimport { FormItemFieldContext } from './FormItemFieldContext'\n\ntype Props = Omit<AntdFormItemProps, 'name' | 'children'> &\n Pick<FormikFieldProps, 'name' | 'validate'> & {\n children: ReactNode\n showValidateSuccess?: boolean\n showInitialErrorAfterTouched?: boolean\n }\n\nexport const FormItem = ({\n name,\n validate,\n children,\n showValidateSuccess,\n showInitialErrorAfterTouched = false,\n ...props\n}: Props) => {\n const form = useFormikContext()\n const error = getIn(form.errors, name)\n const initialError = getIn(form.initialErrors, name)\n const touched = getIn(form.touched, name, false)\n const isTouched = Array.isArray(touched)\n ? touched.length === 0 || touched.some(Boolean)\n : touched\n const hasError = error !== undefined && isTouched\n const showInitialError =\n initialError !== undefined && (!isTouched || showInitialErrorAfterTouched)\n const isValid = !error && isTouched\n\n const item = (\n <AntdForm.Item\n htmlFor={name}\n id={name}\n validateStatus={\n hasError || (initialError !== undefined && !isTouched)\n ? 'error'\n : isValid && showValidateSuccess\n ? 'success'\n : undefined\n }\n hasFeedback={isValid}\n help={\n hasError || showInitialError ? (\n <>\n {hasError && <li>{error}</li>}\n {showInitialError && <li>{initialError}</li>}\n </>\n ) : null\n }\n {...props}\n >\n {/* Formik owns values and validation; do not register an antd field. */}\n {children}\n </AntdForm.Item>\n )\n // Display-only items must not register a second field over their control.\n // When validate is supplied, the item owns validation (as before).\n return validate ? (\n <FormikField name={name} validate={validate}>\n {(fieldProps) => (\n <FormItemFieldContext.Provider value={fieldProps}>\n {item}\n </FormItemFieldContext.Provider>\n )}\n </FormikField>\n ) : (\n item\n )\n}\n"],"names":["AntdForm"],"mappings":";;;;;AAaO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,+BAA+B;AAAA,EAC/B,GAAG;AACL,MAAa;AACX,QAAM,OAAO,iBAAA;AACb,QAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI;AACrC,QAAM,eAAe,MAAM,KAAK,eAAe,IAAI;AACnD,QAAM,UAAU,MAAM,KAAK,SAAS,MAAM,KAAK;AAC/C,QAAM,YAAY,MAAM,QAAQ,OAAO,IACnC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO,IAC5C;AACJ,QAAM,WAAW,UAAU,UAAa;AACxC,QAAM,mBACJ,iBAAiB,WAAc,CAAC,aAAa;AAC/C,QAAM,UAAU,CAAC,SAAS;AAE1B,QAAM,OACJ;AAAA,IAACA,KAAS;AAAA,IAAT;AAAA,MACC,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,gBACE,YAAa,iBAAiB,UAAa,CAAC,YACxC,UACA,WAAW,sBACT,YACA;AAAA,MAER,aAAa;AAAA,MACb,MACE,YAAY,mBACV,qBAAA,UAAA,EACG,UAAA;AAAA,QAAA,YAAY,oBAAC,QAAI,UAAA,MAAA,CAAM;AAAA,QACvB,oBAAoB,oBAAC,MAAA,EAAI,UAAA,aAAA,CAAa;AAAA,MAAA,EAAA,CACzC,IACE;AAAA,MAEL,GAAG;AAAA,MAGH;AAAA,IAAA;AAAA,EAAA;AAKL,SAAO,WACL,oBAAC,aAAA,EAAY,MAAY,UACtB,UAAA,CAAC,eACA,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,YACnC,UAAA,KAAA,CACH,GAEJ,IAEA;AAEJ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const FormItemFieldContext = React.createContext(
|
|
5
|
+
void 0
|
|
6
|
+
);
|
|
7
|
+
exports.FormItemFieldContext = FormItemFieldContext;
|
|
8
|
+
//# sourceMappingURL=FormItemFieldContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormItemFieldContext.cjs","sources":["../../../../src/components/form/FormItemFieldContext.ts"],"sourcesContent":["import type { FieldProps } from 'formik'\nimport { createContext } from 'react'\n\n// An item with its own validator owns the field registration. Its controls\n// reuse that binding so mounting or unmounting them cannot replace the validator.\nexport const FormItemFieldContext = createContext<FieldProps | undefined>(\n undefined\n)\n"],"names":["createContext"],"mappings":";;;AAKO,MAAM,uBAAuBA,MAAAA;AAAAA,EAClC;AACF;;"}
|