@atom-learning/components 5.5.0-beta.1 → 5.5.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/CHANGELOG.md +212 -0
- package/dist/components/action-icon/ActionIcon.d.ts +1 -1
- package/dist/components/banner/Banner.d.ts +2 -2
- package/dist/components/banner/banner-regular/BannerRegular.d.ts +469 -102
- package/dist/components/banner/banner-regular/BannerRegularDismiss.d.ts +3 -3
- package/dist/components/banner/banner-slim/BannerSlim.d.ts +481 -114
- package/dist/components/banner/banner-slim/BannerSlimDismiss.d.ts +3 -3
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/checkbox-field/CheckboxField.js +1 -1
- package/dist/components/checkbox-field/CheckboxField.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +90 -90
- package/dist/components/checkbox-tree/CheckboxTree.d.ts +344 -344
- package/dist/components/create-password-field/CreatePasswordField.d.ts +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +98 -110
- package/dist/components/date-field/DateField.d.ts +1 -1
- package/dist/components/date-field/DateField.js +1 -1
- package/dist/components/date-field/DateField.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +2 -2
- package/dist/components/dismissible/index.d.ts +2 -2
- package/dist/components/dismissible-group/index.d.ts +3 -3
- package/dist/components/field-wrapper/FieldWrapper.d.ts +1 -3
- package/dist/components/field-wrapper/FieldWrapper.js +1 -1
- package/dist/components/field-wrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/Form.d.ts +2 -3
- package/dist/components/form/Form.js +1 -1
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/heading/Heading.d.ts +0 -1
- package/dist/components/heading/Heading.js +1 -1
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/input/Input.d.ts +1 -3
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input-field/InputField.d.ts +1 -1
- package/dist/components/input-field/InputField.js +1 -1
- package/dist/components/input-field/InputField.js.map +1 -1
- package/dist/components/keyboard-shortcut/index.d.ts +2 -2
- package/dist/components/label/Label.d.ts +1 -2
- package/dist/components/label/Label.js +1 -1
- package/dist/components/label/Label.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +162 -162
- package/dist/components/number-input/NumberInput.d.ts +1 -2
- package/dist/components/number-input/NumberInput.js +1 -1
- package/dist/components/number-input/NumberInput.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.d.ts +1 -756
- package/dist/components/number-input/NumberInputStepper.js +1 -1
- package/dist/components/number-input/NumberInputStepper.js.map +1 -1
- package/dist/components/number-input-field/NumberInputField.d.ts +1 -1
- package/dist/components/number-input-field/NumberInputField.js +1 -1
- package/dist/components/number-input-field/NumberInputField.js.map +1 -1
- package/dist/components/pagination/PaginationNextButton.d.ts +3 -3
- package/dist/components/pagination/PaginationPopover.js +1 -1
- package/dist/components/pagination/PaginationPopover.js.map +1 -1
- package/dist/components/pagination/PaginationPreviousButton.d.ts +3 -3
- package/dist/components/password-field/PasswordField.d.ts +1 -1
- package/dist/components/password-field/PasswordField.js +1 -1
- package/dist/components/password-field/PasswordField.js.map +1 -1
- package/dist/components/radio-button-field/RadioButtonField.js +1 -1
- package/dist/components/radio-button-field/RadioButtonField.js.map +1 -1
- package/dist/components/search-field/SearchField.d.ts +1 -1
- package/dist/components/search-field/SearchField.js +1 -1
- package/dist/components/search-field/SearchField.js.map +1 -1
- package/dist/components/search-input/SearchInput.js +1 -1
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/section-message/SectionMessage.d.ts +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts +9 -9
- package/dist/components/select/Select.d.ts +0 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-field/SelectField.d.ts +1 -1
- package/dist/components/select-field/SelectField.js +1 -1
- package/dist/components/select-field/SelectField.js.map +1 -1
- package/dist/components/side-bar/SideBarComponents.d.ts +1 -1
- package/dist/components/sortable/Handle.d.ts +3 -3
- package/dist/components/sortable/index.d.ts +3 -3
- package/dist/components/stepper/StepperStepLabel.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +0 -1
- package/dist/components/textarea/Textarea.js +1 -1
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea-field/TextareaField.d.ts +1 -1
- package/dist/components/textarea-field/TextareaField.js +1 -1
- package/dist/components/textarea-field/TextareaField.js.map +1 -1
- package/dist/components/tile/Tile.d.ts +0 -1
- package/dist/components/tile/Tile.js +1 -1
- package/dist/components/tile/Tile.js.map +1 -1
- package/dist/components/tile-interactive/TileInteractive.d.ts +1 -2
- package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +1 -2
- package/dist/components/toggle-group/index.d.ts +2 -2
- package/dist/components/top-bar/TopBar.d.ts +4 -5
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/components/top-bar/TopBar.js.map +1 -1
- package/dist/components/tree/Tree.d.ts +243 -243
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/components/form/useFormCustomContext.d.ts +0 -7
- package/dist/components/form/useFormCustomContext.js +0 -2
- package/dist/components/form/useFormCustomContext.js.map +0 -1
|
@@ -12,7 +12,7 @@ type CreatePasswordFieldProps = Override<React.ComponentProps<typeof PasswordInp
|
|
|
12
12
|
messageDirection?: CSS['flexDirection'];
|
|
13
13
|
}>;
|
|
14
14
|
export declare const CreatePasswordField: {
|
|
15
|
-
({ validate, defaultValidation, messageDirection, label, name, css, validation,
|
|
15
|
+
({ validate, defaultValidation, messageDirection, label, name, css, validation, ...remainingProps }: CreatePasswordFieldProps): React.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import j from"invariant";import*as a from"react";import{useFormContext as E}from"react-hook-form";import{throttle as k}from"throttle-debounce";import{Box as P}from"../box/Box.js";import{Flex as S}from"../flex/Flex.js";import{InlineMessage as B}from"../inline-message/InlineMessage.js";import{PasswordField as D}from"../password-field/PasswordField.js";const c=({validate:d,defaultValidation:u,messageDirection:p="row",label:f="Create a password",name:r="password",css:v,validation:b,...w})=>{var s;const{formState:l}=E(),[i,n]=a.useState(!1),[C,m]=a.useState(u),g=l.touched[r],F=((s=l.errors[r])==null?void 0:s.type)==="validate",o=a.useCallback(async e=>{const t=await d(e);return t?(j(typeof t=="object","The validate function must return an object"),m(t),Object.values(t).every(h=>h)):!1},[m]),x=a.useCallback(k(500,o),[o]),y=(e,t)=>e?"success":t?"neutral":"error";return a.createElement(P,{css:v},a.createElement(D,{label:f,name:r,onChange:e=>x(e.target.value),onBlur:()=>n(!1),onFocus:()=>n(!0),validation:{...b,validate:o},...w}),(g||i||F)&&a.createElement(S,{css:{mt:"$2",gap:"$2",flexWrap:"wrap",flexDirection:p}},Object.entries(C).map(([e,t])=>a.createElement(B,{key:e,theme:y(t,i)},e))))};c.displayName="CreatePasswordField";export{c as CreatePasswordField};
|
|
2
2
|
//# sourceMappingURL=CreatePasswordField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePasswordField.js","sources":["../../../src/components/create-password-field/CreatePasswordField.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { throttle } from 'throttle-debounce'\n\nimport type { CSS } from '~/stitches'\nimport { Override } from '~/utilities'\n\nimport { Box } from '../box'\nimport { FieldElementWrapperProps } from '../field-wrapper'\nimport { Flex } from '../flex'\nimport { InlineMessage } from '../inline-message'\nimport { PasswordField } from '../password-field'\nimport { PasswordInput } from '../password-input'\n\ntype ValidationResult = Record<string, boolean>\n\ntype CreatePasswordFieldProps = Override<\n React.ComponentProps<typeof PasswordInput> & FieldElementWrapperProps,\n {\n label?: string\n name?: string\n validate: (\n password: string\n ) => Promise<ValidationResult | undefined> | ValidationResult\n defaultValidation: ValidationResult\n messageDirection?: CSS['flexDirection']\n }\n>\n\nexport const CreatePasswordField = ({\n validate,\n defaultValidation,\n messageDirection = 'row',\n label = 'Create a password',\n name = 'password',\n css,\n validation,\n
|
|
1
|
+
{"version":3,"file":"CreatePasswordField.js","sources":["../../../src/components/create-password-field/CreatePasswordField.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { throttle } from 'throttle-debounce'\n\nimport type { CSS } from '~/stitches'\nimport { Override } from '~/utilities'\n\nimport { Box } from '../box'\nimport { FieldElementWrapperProps } from '../field-wrapper'\nimport { Flex } from '../flex'\nimport { InlineMessage } from '../inline-message'\nimport { PasswordField } from '../password-field'\nimport { PasswordInput } from '../password-input'\n\ntype ValidationResult = Record<string, boolean>\n\ntype CreatePasswordFieldProps = Override<\n React.ComponentProps<typeof PasswordInput> & FieldElementWrapperProps,\n {\n label?: string\n name?: string\n validate: (\n password: string\n ) => Promise<ValidationResult | undefined> | ValidationResult\n defaultValidation: ValidationResult\n messageDirection?: CSS['flexDirection']\n }\n>\n\nexport const CreatePasswordField = ({\n validate,\n defaultValidation,\n messageDirection = 'row',\n label = 'Create a password',\n name = 'password',\n css,\n validation,\n ...remainingProps\n}: CreatePasswordFieldProps) => {\n const { formState } = useFormContext()\n const [isFocused, setIsFocused] = React.useState<boolean>(false)\n const [validationResult, setValidationResult] =\n React.useState<ValidationResult>(defaultValidation)\n\n const touched = formState.touched[name]\n const error = formState.errors[name]?.type === 'validate'\n\n const validatePassword = React.useCallback(\n async (password: string) => {\n const result = await validate(password)\n\n if (result) {\n invariant(\n typeof result === 'object',\n 'The validate function must return an object'\n )\n\n setValidationResult(result)\n return Object.values(result).every((isValid) => isValid)\n }\n\n return false\n },\n [setValidationResult]\n )\n\n const handleChange = React.useCallback(throttle(500, validatePassword), [\n validatePassword\n ])\n\n const getMessageTheme = (result: boolean, isFocused: boolean) => {\n if (result) return 'success'\n\n return isFocused ? 'neutral' : 'error'\n }\n\n return (\n <Box css={css}>\n <PasswordField\n label={label}\n name={name}\n onChange={(e) => handleChange(e.target.value)}\n onBlur={() => setIsFocused(false)}\n onFocus={() => setIsFocused(true)}\n validation={{ ...validation, validate: validatePassword }}\n {...remainingProps}\n />\n {(touched || isFocused || error) && (\n <Flex\n css={{\n mt: '$2',\n gap: '$2',\n flexWrap: 'wrap',\n flexDirection: messageDirection\n }}\n >\n {Object.entries(validationResult).map(([message, result]) => (\n <InlineMessage\n key={message}\n theme={getMessageTheme(result, isFocused)}\n >\n {message}\n </InlineMessage>\n ))}\n </Flex>\n )}\n </Box>\n )\n}\n\nCreatePasswordField.displayName = 'CreatePasswordField'\n"],"names":["CreatePasswordField","validate","defaultValidation","messageDirection","label","name","css","validation","remainingProps","_a","formState","useFormContext","isFocused","setIsFocused","React","validationResult","setValidationResult","touched","error","validatePassword","password","result","invariant","isValid","handleChange","throttle","getMessageTheme","Box","PasswordField","Flex","message","InlineMessage"],"mappings":"gWA8Ba,MAAAA,EAAsB,CAAC,CAClC,SAAAC,EACA,kBAAAC,EACA,iBAAAC,EAAmB,MACnB,MAAAC,EAAQ,oBACR,KAAAC,EAAO,WACP,IAAAC,EACA,WAAAC,KACGC,CACL,IAAgC,CAvChC,IAAAC,EAwCE,KAAM,CAAE,UAAAC,CAAU,EAAIC,EAAAA,EAChB,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAkB,EAAK,EACzD,CAACC,EAAkBC,CAAmB,EAC1CF,EAAM,SAA2BZ,CAAiB,EAE9Ce,EAAUP,EAAU,QAAQL,GAC5Ba,IAAQT,EAAAC,EAAU,OAAOL,KAAjB,KAAA,OAAAI,EAAwB,QAAS,WAEzCU,EAAmBL,EAAM,YAC7B,MAAOM,GAAqB,CAC1B,MAAMC,EAAS,MAAMpB,EAASmB,CAAQ,EAEtC,OAAIC,GACFC,EACE,OAAOD,GAAW,SAClB,6CACF,EAEAL,EAAoBK,CAAM,EACnB,OAAO,OAAOA,CAAM,EAAE,MAAOE,GAAYA,CAAO,GAGlD,EACT,EACA,CAACP,CAAmB,CACtB,EAEMQ,EAAeV,EAAM,YAAYW,EAAS,IAAKN,CAAgB,EAAG,CACtEA,CACF,CAAC,EAEKO,EAAkB,CAACL,EAAiBT,IACpCS,EAAe,UAEZT,EAAY,UAAY,QAGjC,OACEE,EAAA,cAACa,EAAA,CAAI,IAAKrB,CAAAA,EACRQ,EAAA,cAACc,EAAA,CACC,MAAOxB,EACP,KAAMC,EACN,SAAW,GAAMmB,EAAa,EAAE,OAAO,KAAK,EAC5C,OAAQ,IAAMX,EAAa,EAAK,EAChC,QAAS,IAAMA,EAAa,EAAI,EAChC,WAAY,CAAE,GAAGN,EAAY,SAAUY,CAAiB,EACvD,GAAGX,CAAAA,CACN,GACES,GAAWL,GAAaM,IACxBJ,EAAA,cAACe,EAAA,CACC,IAAK,CACH,GAAI,KACJ,IAAK,KACL,SAAU,OACV,cAAe1B,CACjB,CAAA,EAEC,OAAO,QAAQY,CAAgB,EAAE,IAAI,CAAC,CAACe,EAAST,CAAM,IACrDP,EAAA,cAACiB,EAAA,CACC,IAAKD,EACL,MAAOJ,EAAgBL,EAAQT,CAAS,CAEvCkB,EAAAA,CACH,CACD,CACH,CAEJ,CAEJ,EAEA9B,EAAoB,YAAc"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defaultSort, initialState, disabledRows, enableRowSelection, onRowSelectionChange, children }: {
|
|
7
7
|
columns: any;
|
|
8
8
|
defaultSort?: import("./DataTable.types").TDefaultSort;
|
|
9
|
-
children:
|
|
9
|
+
children: import("react").ReactNode;
|
|
10
10
|
initialState?: import("./DataTable.types").InitialState;
|
|
11
11
|
disabledRows?: Record<string, boolean>;
|
|
12
12
|
enableRowSelection?: boolean | ((row: import("@tanstack/table-core").Row<unknown>) => boolean);
|
|
@@ -24,9 +24,9 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
24
24
|
* you can build your own implementation with `useDataTable()` and the UI-only `Table` components.
|
|
25
25
|
*/
|
|
26
26
|
Body: ({ striped, ...props }: {
|
|
27
|
-
color?: string | undefined
|
|
28
|
-
content?: string | undefined
|
|
29
|
-
translate?: "yes" | "no" | undefined
|
|
27
|
+
color?: string | undefined;
|
|
28
|
+
content?: string | undefined;
|
|
29
|
+
translate?: "yes" | "no" | undefined;
|
|
30
30
|
css?: import("@atom-learning/stitches-react/types/css-util").CSS<{
|
|
31
31
|
sm: string;
|
|
32
32
|
md: string;
|
|
@@ -383,105 +383,105 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
383
383
|
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
384
384
|
};
|
|
385
385
|
}> | undefined;
|
|
386
|
-
prefix?: string | undefined
|
|
387
|
-
slot?: string | undefined
|
|
386
|
+
prefix?: string | undefined;
|
|
387
|
+
slot?: string | undefined;
|
|
388
388
|
style?: import("react").CSSProperties | undefined;
|
|
389
|
-
title?: string | undefined
|
|
389
|
+
title?: string | undefined;
|
|
390
390
|
ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
|
|
391
391
|
key?: import("react").Key | null | undefined;
|
|
392
|
-
defaultChecked?: boolean | undefined
|
|
392
|
+
defaultChecked?: boolean | undefined;
|
|
393
393
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
394
|
-
suppressContentEditableWarning?: boolean | undefined
|
|
395
|
-
suppressHydrationWarning?: boolean | undefined
|
|
396
|
-
accessKey?: string | undefined
|
|
397
|
-
autoFocus?: boolean | undefined
|
|
398
|
-
className?: string | undefined
|
|
399
|
-
contentEditable?:
|
|
400
|
-
contextMenu?: string | undefined
|
|
401
|
-
dir?: string | undefined
|
|
394
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
395
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
396
|
+
accessKey?: string | undefined;
|
|
397
|
+
autoFocus?: boolean | undefined;
|
|
398
|
+
className?: string | undefined;
|
|
399
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
400
|
+
contextMenu?: string | undefined;
|
|
401
|
+
dir?: string | undefined;
|
|
402
402
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
403
|
-
hidden?: boolean | undefined
|
|
404
|
-
id?: string | undefined
|
|
405
|
-
lang?: string | undefined
|
|
406
|
-
nonce?: string | undefined
|
|
407
|
-
placeholder?: string | undefined
|
|
403
|
+
hidden?: boolean | undefined;
|
|
404
|
+
id?: string | undefined;
|
|
405
|
+
lang?: string | undefined;
|
|
406
|
+
nonce?: string | undefined;
|
|
407
|
+
placeholder?: string | undefined;
|
|
408
408
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
409
|
-
tabIndex?: number | undefined
|
|
410
|
-
radioGroup?: string | undefined
|
|
409
|
+
tabIndex?: number | undefined;
|
|
410
|
+
radioGroup?: string | undefined;
|
|
411
411
|
role?: import("react").AriaRole | undefined;
|
|
412
|
-
about?: string | undefined
|
|
413
|
-
datatype?: string | undefined
|
|
412
|
+
about?: string | undefined;
|
|
413
|
+
datatype?: string | undefined;
|
|
414
414
|
inlist?: any;
|
|
415
|
-
property?: string | undefined
|
|
416
|
-
rel?: string | undefined
|
|
417
|
-
resource?: string | undefined
|
|
418
|
-
rev?: string | undefined
|
|
419
|
-
typeof?: string | undefined
|
|
420
|
-
vocab?: string | undefined
|
|
421
|
-
autoCapitalize?: string | undefined
|
|
422
|
-
autoCorrect?: string | undefined
|
|
423
|
-
autoSave?: string | undefined
|
|
424
|
-
itemProp?: string | undefined
|
|
425
|
-
itemScope?: boolean | undefined
|
|
426
|
-
itemType?: string | undefined
|
|
427
|
-
itemID?: string | undefined
|
|
428
|
-
itemRef?: string | undefined
|
|
429
|
-
results?: number | undefined
|
|
430
|
-
security?: string | undefined
|
|
431
|
-
unselectable?: "on" | "off" | undefined
|
|
432
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined
|
|
433
|
-
is?: string | undefined
|
|
434
|
-
"aria-activedescendant"?: string | undefined
|
|
415
|
+
property?: string | undefined;
|
|
416
|
+
rel?: string | undefined;
|
|
417
|
+
resource?: string | undefined;
|
|
418
|
+
rev?: string | undefined;
|
|
419
|
+
typeof?: string | undefined;
|
|
420
|
+
vocab?: string | undefined;
|
|
421
|
+
autoCapitalize?: string | undefined;
|
|
422
|
+
autoCorrect?: string | undefined;
|
|
423
|
+
autoSave?: string | undefined;
|
|
424
|
+
itemProp?: string | undefined;
|
|
425
|
+
itemScope?: boolean | undefined;
|
|
426
|
+
itemType?: string | undefined;
|
|
427
|
+
itemID?: string | undefined;
|
|
428
|
+
itemRef?: string | undefined;
|
|
429
|
+
results?: number | undefined;
|
|
430
|
+
security?: string | undefined;
|
|
431
|
+
unselectable?: "on" | "off" | undefined;
|
|
432
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
433
|
+
is?: string | undefined;
|
|
434
|
+
"aria-activedescendant"?: string | undefined;
|
|
435
435
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
436
|
-
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined
|
|
436
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
437
437
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
438
|
-
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined
|
|
439
|
-
"aria-colcount"?: number | undefined
|
|
440
|
-
"aria-colindex"?: number | undefined
|
|
441
|
-
"aria-colspan"?: number | undefined
|
|
442
|
-
"aria-controls"?: string | undefined
|
|
443
|
-
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined
|
|
444
|
-
"aria-describedby"?: string | undefined
|
|
445
|
-
"aria-details"?: string | undefined
|
|
438
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
439
|
+
"aria-colcount"?: number | undefined;
|
|
440
|
+
"aria-colindex"?: number | undefined;
|
|
441
|
+
"aria-colspan"?: number | undefined;
|
|
442
|
+
"aria-controls"?: string | undefined;
|
|
443
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
444
|
+
"aria-describedby"?: string | undefined;
|
|
445
|
+
"aria-details"?: string | undefined;
|
|
446
446
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
447
|
-
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined
|
|
448
|
-
"aria-errormessage"?: string | undefined
|
|
447
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
448
|
+
"aria-errormessage"?: string | undefined;
|
|
449
449
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
450
|
-
"aria-flowto"?: string | undefined
|
|
450
|
+
"aria-flowto"?: string | undefined;
|
|
451
451
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
452
|
-
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined
|
|
452
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
453
453
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
454
|
-
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined
|
|
455
|
-
"aria-keyshortcuts"?: string | undefined
|
|
456
|
-
"aria-label"?: string | undefined
|
|
457
|
-
"aria-labelledby"?: string | undefined
|
|
458
|
-
"aria-level"?: number | undefined
|
|
459
|
-
"aria-live"?: "off" | "assertive" | "polite" | undefined
|
|
454
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
455
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
456
|
+
"aria-label"?: string | undefined;
|
|
457
|
+
"aria-labelledby"?: string | undefined;
|
|
458
|
+
"aria-level"?: number | undefined;
|
|
459
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
460
460
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
461
461
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
462
462
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
463
|
-
"aria-orientation"?: "horizontal" | "vertical" | undefined
|
|
464
|
-
"aria-owns"?: string | undefined
|
|
465
|
-
"aria-placeholder"?: string | undefined
|
|
466
|
-
"aria-posinset"?: number | undefined
|
|
467
|
-
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined
|
|
463
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
464
|
+
"aria-owns"?: string | undefined;
|
|
465
|
+
"aria-placeholder"?: string | undefined;
|
|
466
|
+
"aria-posinset"?: number | undefined;
|
|
467
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
468
468
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
469
|
-
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined
|
|
469
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
470
470
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
471
|
-
"aria-roledescription"?: string | undefined
|
|
472
|
-
"aria-rowcount"?: number | undefined
|
|
473
|
-
"aria-rowindex"?: number | undefined
|
|
474
|
-
"aria-rowspan"?: number | undefined
|
|
471
|
+
"aria-roledescription"?: string | undefined;
|
|
472
|
+
"aria-rowcount"?: number | undefined;
|
|
473
|
+
"aria-rowindex"?: number | undefined;
|
|
474
|
+
"aria-rowspan"?: number | undefined;
|
|
475
475
|
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
476
|
-
"aria-setsize"?: number | undefined
|
|
477
|
-
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined
|
|
478
|
-
"aria-valuemax"?: number | undefined
|
|
479
|
-
"aria-valuemin"?: number | undefined
|
|
480
|
-
"aria-valuenow"?: number | undefined
|
|
481
|
-
"aria-valuetext"?: string | undefined
|
|
476
|
+
"aria-setsize"?: number | undefined;
|
|
477
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
478
|
+
"aria-valuemax"?: number | undefined;
|
|
479
|
+
"aria-valuemin"?: number | undefined;
|
|
480
|
+
"aria-valuenow"?: number | undefined;
|
|
481
|
+
"aria-valuetext"?: string | undefined;
|
|
482
482
|
dangerouslySetInnerHTML?: {
|
|
483
483
|
__html: string | TrustedHTML;
|
|
484
|
-
} | undefined
|
|
484
|
+
} | undefined;
|
|
485
485
|
onCopy?: import("react").ClipboardEventHandler<HTMLTableSectionElement> | undefined;
|
|
486
486
|
onCopyCapture?: import("react").ClipboardEventHandler<HTMLTableSectionElement> | undefined;
|
|
487
487
|
onCut?: import("react").ClipboardEventHandler<HTMLTableSectionElement> | undefined;
|
|
@@ -2170,10 +2170,10 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
2170
2170
|
};
|
|
2171
2171
|
}> | undefined;
|
|
2172
2172
|
}, "size" | "as" | "type"> & {
|
|
2173
|
-
size:
|
|
2173
|
+
size: import("react").ComponentProps<typeof import("..").Text>["size"];
|
|
2174
2174
|
type?: "text" | "number" | "email" | "password" | "tel" | "url" | "search";
|
|
2175
2175
|
as?: never;
|
|
2176
|
-
}, "
|
|
2176
|
+
}, "size" | "state"> & {
|
|
2177
2177
|
size?: "sm" | "md" | "lg" | "xl" | ({
|
|
2178
2178
|
"@sm"?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
2179
2179
|
"@md"?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
@@ -2198,18 +2198,6 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
2198
2198
|
} & {
|
|
2199
2199
|
[x: string]: "error" | undefined;
|
|
2200
2200
|
}) | undefined;
|
|
2201
|
-
appearance?: "standard" | "modern" | ({
|
|
2202
|
-
"@sm"?: "standard" | "modern" | undefined;
|
|
2203
|
-
"@md"?: "standard" | "modern" | undefined;
|
|
2204
|
-
"@lg"?: "standard" | "modern" | undefined;
|
|
2205
|
-
"@xl"?: "standard" | "modern" | undefined;
|
|
2206
|
-
"@reducedMotion"?: "standard" | "modern" | undefined;
|
|
2207
|
-
"@allowMotion"?: "standard" | "modern" | undefined;
|
|
2208
|
-
"@hover"?: "standard" | "modern" | undefined;
|
|
2209
|
-
"@initial"?: "standard" | "modern" | undefined;
|
|
2210
|
-
} & {
|
|
2211
|
-
[x: string]: "standard" | "modern" | undefined;
|
|
2212
|
-
}) | undefined;
|
|
2213
2201
|
} & {
|
|
2214
2202
|
size?: "sm" | "md" | "lg";
|
|
2215
2203
|
css?: import("../..").CSS;
|
|
@@ -2217,7 +2205,7 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
2217
2205
|
defaultValue?: string;
|
|
2218
2206
|
onValueChange?: (newValue: string) => void;
|
|
2219
2207
|
clearText?: string;
|
|
2220
|
-
onChange?: (e:
|
|
2208
|
+
onChange?: (e: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
2221
2209
|
} & {
|
|
2222
2210
|
label: string;
|
|
2223
2211
|
hideLabel?: boolean;
|
|
@@ -3393,7 +3381,7 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
3393
3381
|
* If you need more customisation, you can compose your own implentation, `asyncDataState`
|
|
3394
3382
|
* can be retrieved from `useDataTable`
|
|
3395
3383
|
*/
|
|
3396
|
-
Loading: (props:
|
|
3384
|
+
Loading: (props: import("react").ComponentProps<import("@atom-learning/stitches-react/types/styled-component").StyledComponent<({ css, message, size, ...props }: {
|
|
3397
3385
|
message?: string;
|
|
3398
3386
|
size?: "sm" | "md" | "lg";
|
|
3399
3387
|
css?: import("../..").CSS;
|
|
@@ -3773,7 +3761,7 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
3773
3761
|
*
|
|
3774
3762
|
*/
|
|
3775
3763
|
Error: ({ children }: {
|
|
3776
|
-
children: (retry?: import("./DataTable.types").DataTableContextType["runAsyncData"]) =>
|
|
3764
|
+
children: (retry?: import("./DataTable.types").DataTableContextType["runAsyncData"]) => import("react").ReactElement;
|
|
3777
3765
|
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
3778
3766
|
/** Empty state implementation for `DataTable`.
|
|
3779
3767
|
*
|
|
@@ -4536,31 +4524,31 @@ export declare const DataTable: (({ columns, data: dataProp, getAsyncData, defau
|
|
|
4536
4524
|
checked: boolean | "indeterminate";
|
|
4537
4525
|
onCheckedChange: (value: boolean) => void;
|
|
4538
4526
|
label?: string;
|
|
4539
|
-
}) =>
|
|
4527
|
+
}) => import("react").ReactElement;
|
|
4540
4528
|
/** Empty state implementation for `DataTable`.
|
|
4541
4529
|
*
|
|
4542
4530
|
* Renders a checkbox on the header, allowing for individual selection/deselection of any selectable row
|
|
4543
4531
|
*/
|
|
4544
4532
|
BulkActions: (({ children, ...rest }: {
|
|
4545
4533
|
css?: import("../..").CSS;
|
|
4546
|
-
children:
|
|
4547
|
-
children:
|
|
4548
|
-
}) =>
|
|
4534
|
+
children: import("react").ReactElement<import("react").ComponentProps<({ children }: {
|
|
4535
|
+
children: import("react").ReactElement;
|
|
4536
|
+
}) => import("react").ReactElement | null>> | import("react").ReactElement<import("react").ComponentProps<({ cancelLabel, children }: {
|
|
4549
4537
|
cancelLabel?: string;
|
|
4550
|
-
children:
|
|
4551
|
-
}) => import("react").JSX.Element | null>> | [
|
|
4552
|
-
children:
|
|
4553
|
-
}) =>
|
|
4538
|
+
children: import("react").ReactNode;
|
|
4539
|
+
}) => import("react").JSX.Element | null>> | [import("react").ReactElement<import("react").ComponentProps<({ children }: {
|
|
4540
|
+
children: import("react").ReactElement;
|
|
4541
|
+
}) => import("react").ReactElement | null>>, import("react").ReactElement<import("react").ComponentProps<({ cancelLabel, children }: {
|
|
4554
4542
|
cancelLabel?: string;
|
|
4555
|
-
children:
|
|
4543
|
+
children: import("react").ReactNode;
|
|
4556
4544
|
}) => import("react").JSX.Element | null>>];
|
|
4557
4545
|
}) => import("react").JSX.Element) & {
|
|
4558
4546
|
DefaultActions: ({ children }: {
|
|
4559
|
-
children:
|
|
4560
|
-
}) =>
|
|
4547
|
+
children: import("react").ReactElement;
|
|
4548
|
+
}) => import("react").ReactElement | null;
|
|
4561
4549
|
SelectedRowActions: ({ cancelLabel, children }: {
|
|
4562
4550
|
cancelLabel?: string;
|
|
4563
|
-
children:
|
|
4551
|
+
children: import("react").ReactNode;
|
|
4564
4552
|
}) => import("react").JSX.Element | null;
|
|
4565
4553
|
};
|
|
4566
4554
|
};
|
|
@@ -3,7 +3,7 @@ import { DateInputProps } from '../../components/date-input';
|
|
|
3
3
|
import { FieldElementWrapperProps } from '../../components/field-wrapper';
|
|
4
4
|
type DateFieldProps = DateInputProps & FieldElementWrapperProps;
|
|
5
5
|
export declare const DateField: {
|
|
6
|
-
({ css, hideLabel, label, name, validation, prompt, description,
|
|
6
|
+
({ css, hideLabel, label, name, validation, prompt, description, ...remainingProps }: DateFieldProps): React.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as i from"react";import{useFormContext as
|
|
1
|
+
import*as i from"react";import{useFormContext as u}from"react-hook-form";import{DateInput as F}from"../date-input/DateInput.js";import{FieldWrapper as b}from"../field-wrapper/FieldWrapper.js";import"../field-wrapper/InlineFieldWrapper.js";import"../form/Form.js";import{useFieldError as g}from"../form/useFieldError.js";const a=({css:m,hideLabel:l,label:p,name:e,validation:r,prompt:d,description:n,...s})=>{const{register:t,trigger:c}=u(),{error:o}=g(e),f=r?t(r):t;return i.createElement(b,{css:m,description:n,error:o,fieldId:e,hideLabel:l,label:p,prompt:d,required:Boolean(r==null?void 0:r.required)},i.createElement(F,{id:e,name:e,ref:f,...o&&{state:"error"},...s,revalidate:c}))};a.displayName="DateField";export{a as DateField};
|
|
2
2
|
//# sourceMappingURL=DateField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","sources":["../../../src/components/date-field/DateField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport { DateInput, DateInputProps } from '~/components/date-input'\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper'\nimport { useFieldError } from '~/components/form'\n\ntype DateFieldProps = DateInputProps & FieldElementWrapperProps\n\nexport const DateField = ({\n css,\n hideLabel,\n label,\n name,\n validation,\n prompt,\n description,\n
|
|
1
|
+
{"version":3,"file":"DateField.js","sources":["../../../src/components/date-field/DateField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport { DateInput, DateInputProps } from '~/components/date-input'\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper'\nimport { useFieldError } from '~/components/form'\n\ntype DateFieldProps = DateInputProps & FieldElementWrapperProps\n\nexport const DateField = ({\n css,\n hideLabel,\n label,\n name,\n validation,\n prompt,\n description,\n ...remainingProps\n}: DateFieldProps) => {\n const { register, trigger } = useFormContext()\n const { error } = useFieldError(name)\n const ref = validation ? register(validation) : register\n\n return (\n <FieldWrapper\n css={css}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n >\n <DateInput\n id={name}\n name={name}\n ref={ref}\n {...(error && { state: 'error' })}\n {...remainingProps}\n revalidate={trigger}\n />\n </FieldWrapper>\n )\n}\n\nDateField.displayName = 'DateField'\n"],"names":["DateField","css","hideLabel","label","name","validation","prompt","description","remainingProps","register","trigger","useFormContext","error","useFieldError","ref","React","FieldWrapper","DateInput"],"mappings":"gUAYO,MAAMA,EAAY,CAAC,CACxB,IAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EACA,WAAAC,EACA,OAAAC,EACA,YAAAC,KACGC,CACL,IAAsB,CACpB,KAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAIC,EACxB,EAAA,CAAE,MAAAC,CAAM,EAAIC,EAAcT,CAAI,EAC9BU,EAAMT,EAAaI,EAASJ,CAAU,EAAII,EAEhD,OACEM,EAAA,cAACC,EAAA,CACC,IAAKf,EACL,YAAaM,EACb,MAAOK,EACP,QAASR,EACT,UAAWF,EACX,MAAOC,EACP,OAAQG,EACR,SAAU,QAAQD,GAAA,KAAA,OAAAA,EAAY,QAAQ,CAAA,EAEtCU,EAAA,cAACE,EAAA,CACC,GAAIb,EACJ,KAAMA,EACN,IAAKU,EACJ,GAAIF,GAAS,CAAE,MAAO,OAAQ,EAC9B,GAAGJ,EACJ,WAAYE,CAAAA,CACd,CACF,CAEJ,EAEAV,EAAU,YAAc"}
|
|
@@ -1824,8 +1824,8 @@ export declare const Dialog: import("@atom-learning/stitches-react/types/styled-
|
|
|
1824
1824
|
closeDialogText?: string;
|
|
1825
1825
|
showCloseButton?: boolean;
|
|
1826
1826
|
}) => import("react").JSX.Element;
|
|
1827
|
-
Heading: ({ css, ...props }:
|
|
1828
|
-
Footer: ({ css, ...props }:
|
|
1827
|
+
Heading: ({ css, ...props }: import("react").ComponentProps<typeof import("..").Heading>) => import("react").JSX.Element;
|
|
1828
|
+
Footer: ({ css, ...props }: import("react").ComponentProps<typeof import("..").Flex>) => import("react").JSX.Element;
|
|
1829
1829
|
Description: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
1830
1830
|
Title: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
1831
1831
|
Trigger: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const Dismissible: {
|
|
2
|
-
({ disabled, dismissed, onDismiss, ...rest }:
|
|
2
|
+
({ disabled, dismissed, onDismiss, ...rest }: import("react").PropsWithChildren<import("./DismissibleRoot").IDismissibleRootInternalProps & import("./DismissibleRoot").IDismissibleRootProps>): import("react").JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
|
-
Trigger: ({ asChild, ...rest }:
|
|
5
|
+
Trigger: ({ asChild, ...rest }: import("react").PropsWithChildren<import("./DismissibleTrigger").IDismissibleTriggerProps>) => import("react").JSX.Element;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const DismissibleGroup: {
|
|
2
|
-
({ as: Component, disabled, onDismiss, ...rest }:
|
|
2
|
+
({ as: Component, disabled, onDismiss, ...rest }: import("react").PropsWithChildren<import("./DismissibleGroupRoot").IDismissibleGroupRootProps>): import("react").JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
|
-
Item: ({ children, value, disabled: itemDisabled, ...rest }:
|
|
6
|
-
Trigger: ({ asChild, ...rest }:
|
|
5
|
+
Item: ({ children, value, disabled: itemDisabled, ...rest }: import("react").PropsWithChildren<import("./DismissibleGroupItem").TDismissibleGroupItemProps>) => import("react").JSX.Element;
|
|
6
|
+
Trigger: ({ asChild, ...rest }: import("react").PropsWithChildren<import("../../components/dismissible/DismissibleTrigger").IDismissibleTriggerProps>) => import("react").JSX.Element;
|
|
7
7
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ValidationOptions } from '../../components/form';
|
|
3
3
|
import type { CSS } from '../../stitches';
|
|
4
|
-
import { type LabelProps } from '../label/Label';
|
|
5
4
|
export type FieldWrapperProps = {
|
|
6
5
|
css?: CSS;
|
|
7
6
|
error?: string;
|
|
@@ -15,13 +14,12 @@ export type FieldWrapperProps = {
|
|
|
15
14
|
description?: string;
|
|
16
15
|
required?: boolean;
|
|
17
16
|
hideLabel?: boolean;
|
|
18
|
-
appearance?: LabelProps['appearance'];
|
|
19
17
|
};
|
|
20
18
|
export type FieldElementWrapperProps = Omit<FieldWrapperProps, 'fieldId'> & {
|
|
21
19
|
name: string;
|
|
22
20
|
validation?: ValidationOptions;
|
|
23
21
|
};
|
|
24
22
|
export declare const FieldWrapper: {
|
|
25
|
-
({ css, children, error, fieldId, label, prompt, description, required, hideLabel
|
|
23
|
+
({ css, children, error, fieldId, label, prompt, description, required, hideLabel }: React.PropsWithChildren<FieldWrapperProps>): React.JSX.Element;
|
|
26
24
|
displayName: string;
|
|
27
25
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as d from"@radix-ui/react-visually-hidden";import*as r from"react";import{Box as f}from"../box/Box.js";import{Flex as b}from"../flex/Flex.js";import{InlineMessage as u}from"../inline-message/InlineMessage.js";import{Label as E}from"../label/Label.js";import{Link as h}from"../link/Link.js";import{Description as k}from"./FieldDescription.js";const m=({css:l,children:i,error:t,fieldId:n,label:s,prompt:e,description:o,required:c,hideLabel:a})=>{const p=a?d.Root:b;return r.createElement(f,{css:l},r.createElement(p,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},r.createElement(E,{htmlFor:n,required:c},s),e&&r.createElement(h,{href:e==null?void 0:e.link,onClick:e==null?void 0:e.onClick,size:"sm"},e.label)),o&&r.createElement(k,{css:{mb:"$3"}},o),i,t&&r.createElement(u,{css:{mt:"$2"}},t))};m.displayName="FieldWrapper";export{m as FieldWrapper};
|
|
2
2
|
//# sourceMappingURL=FieldWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldWrapper.js","sources":["../../../src/components/field-wrapper/FieldWrapper.tsx"],"sourcesContent":["import * as VisuallyHidden from '@radix-ui/react-visually-hidden'\nimport * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { Flex } from '~/components/flex'\nimport { ValidationOptions } from '~/components/form'\nimport { InlineMessage } from '~/components/inline-message'\nimport { Label } from '~/components/label'\nimport { Link } from '~/components/link'\nimport type { CSS } from '~/stitches'\n\nimport { Description } from './FieldDescription'\
|
|
1
|
+
{"version":3,"file":"FieldWrapper.js","sources":["../../../src/components/field-wrapper/FieldWrapper.tsx"],"sourcesContent":["import * as VisuallyHidden from '@radix-ui/react-visually-hidden'\nimport * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { Flex } from '~/components/flex'\nimport { ValidationOptions } from '~/components/form'\nimport { InlineMessage } from '~/components/inline-message'\nimport { Label } from '~/components/label'\nimport { Link } from '~/components/link'\nimport type { CSS } from '~/stitches'\n\nimport { Description } from './FieldDescription'\n\nexport type FieldWrapperProps = {\n css?: CSS\n error?: string\n fieldId: string\n label: string\n prompt?: { link?: string; label: string; onClick?: () => void }\n description?: string\n required?: boolean\n hideLabel?: boolean\n}\n\nexport type FieldElementWrapperProps = Omit<FieldWrapperProps, 'fieldId'> & {\n name: string\n validation?: ValidationOptions\n}\n\nexport const FieldWrapper = ({\n css,\n children,\n error,\n fieldId,\n label,\n prompt,\n description,\n required,\n hideLabel\n}: React.PropsWithChildren<FieldWrapperProps>) => {\n const LabelContainer = hideLabel ? VisuallyHidden.Root : Flex\n\n return (\n <Box css={css}>\n <LabelContainer\n css={{\n justifyContent: 'space-between',\n alignItems: 'center',\n mb: '$3'\n }}\n >\n <Label htmlFor={fieldId} required={required}>\n {label}\n </Label>\n {prompt && (\n <Link href={prompt?.link} onClick={prompt?.onClick} size=\"sm\">\n {prompt.label}\n </Link>\n )}\n </LabelContainer>\n {description && (\n <Description css={{ mb: '$3' }}>{description}</Description>\n )}\n {children}\n {error && <InlineMessage css={{ mt: '$2' }}>{error}</InlineMessage>}\n </Box>\n )\n}\n\nFieldWrapper.displayName = 'FieldWrapper'\n"],"names":["FieldWrapper","css","children","error","fieldId","label","prompt","description","required","hideLabel","LabelContainer","VisuallyHidden","Flex","React","Box","Label","Link","Description","InlineMessage"],"mappings":"6VA6BO,MAAMA,EAAe,CAAC,CAC3B,IAAAC,EACA,SAAAC,EACA,MAAAC,EACA,QAAAC,EACA,MAAAC,EACA,OAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,CACF,IAAkD,CAChD,MAAMC,EAAiBD,EAAYE,EAAe,KAAOC,EAEzD,OACEC,EAAA,cAACC,EAAA,CAAI,IAAKb,CAAAA,EACRY,EAAA,cAACH,EAAA,CACC,IAAK,CACH,eAAgB,gBAChB,WAAY,SACZ,GAAI,IACN,CAAA,EAEAG,EAAA,cAACE,EAAA,CAAM,QAASX,EAAS,SAAUI,CAChCH,EAAAA,CACH,EACCC,GACCO,EAAA,cAACG,EAAA,CAAK,KAAMV,GAAA,KAAA,OAAAA,EAAQ,KAAM,QAASA,GAAA,YAAAA,EAAQ,QAAS,KAAK,IAAA,EACtDA,EAAO,KACV,CAEJ,EACCC,GACCM,EAAA,cAACI,EAAA,CAAY,IAAK,CAAE,GAAI,IAAK,GAAIV,CAAY,EAE9CL,EACAC,GAASU,EAAA,cAACK,EAAA,CAAc,IAAK,CAAE,GAAI,IAAK,CAAA,EAAIf,CAAM,CACrD,CAEJ,EAEAH,EAAa,YAAc"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DefaultValues, FieldValues, Mode, SubmitErrorHandler, SubmitHandler, UseFormMethods } from 'react-hook-form';
|
|
3
|
-
import { type FormCustomContextType } from './useFormCustomContext';
|
|
4
3
|
declare const StyledForm: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<"form", {}, {
|
|
5
4
|
sm: string;
|
|
6
5
|
md: string;
|
|
@@ -374,7 +373,7 @@ interface FormProps<TFormData extends FieldValues> extends StyledFormProps {
|
|
|
374
373
|
children: React.ReactNode | ((methods: UseFormMethods<TFormData>) => React.ReactNode);
|
|
375
374
|
}
|
|
376
375
|
export declare const Form: {
|
|
377
|
-
<TFormData extends FieldValues>(props: FormProps<TFormData>
|
|
376
|
+
<TFormData extends FieldValues>(props: FormProps<TFormData>): React.JSX.Element;
|
|
378
377
|
displayName: string;
|
|
379
378
|
};
|
|
380
379
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"react";import{useForm as u,FormProvider as f}from"react-hook-form";import{styled as s}from"../../stitches.js";const c=s("form",{}),t=m=>{const{children:o,defaultValues:a,validationMode:l="onBlur",onSubmit:n,onError:i,...d}=m,e=u({defaultValues:a,mode:l});return r.createElement(f,{...e},r.createElement(c,{"aria-label":"form",onSubmit:e.handleSubmit(n,i),...d},typeof o=="function"?o(e):o))};t.displayName="Form";export{t as Form};
|
|
2
2
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../src/components/form/Form.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../src/components/form/Form.tsx"],"sourcesContent":["import React from 'react'\nimport type {\n DefaultValues,\n FieldValues,\n Mode,\n SubmitErrorHandler,\n SubmitHandler,\n UseFormMethods\n} from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\n\nimport { styled } from '~/stitches'\n\nconst StyledForm = styled('form', {})\n\ntype StyledFormProps = Omit<\n React.ComponentPropsWithoutRef<typeof StyledForm>,\n 'onSubmit' | 'onError'\n>\n\ninterface FormProps<TFormData extends FieldValues> extends StyledFormProps {\n defaultValues?: DefaultValues<TFormData>\n validationMode?: Mode\n onSubmit: SubmitHandler<TFormData>\n onError?: SubmitErrorHandler<TFormData>\n children:\n | React.ReactNode\n | ((methods: UseFormMethods<TFormData>) => React.ReactNode)\n}\n\nexport const Form = <TFormData extends FieldValues>(\n props: FormProps<TFormData>\n) => {\n const {\n children,\n defaultValues,\n validationMode = 'onBlur',\n onSubmit,\n onError,\n ...rest\n } = props\n\n const methods = useForm<TFormData>({\n defaultValues,\n mode: validationMode\n })\n\n return (\n <FormProvider {...methods}>\n <StyledForm\n aria-label=\"form\"\n onSubmit={methods.handleSubmit(onSubmit, onError)}\n {...rest}\n >\n {typeof children === 'function' ? children(methods) : children}\n </StyledForm>\n </FormProvider>\n )\n}\n\nForm.displayName = 'Form'\n"],"names":["StyledForm","styled","Form","props","children","defaultValues","validationMode","onSubmit","onError","rest","methods","useForm","React","FormProvider"],"mappings":"4HAaA,MAAMA,EAAaC,EAAO,OAAQ,CAAA,CAAE,EAiBvBC,EACXC,GACG,CACH,KAAM,CACJ,SAAAC,EACA,cAAAC,EACA,eAAAC,EAAiB,SACjB,SAAAC,EACA,QAAAC,KACGC,CACL,EAAIN,EAEEO,EAAUC,EAAmB,CACjC,cAAAN,EACA,KAAMC,CACR,CAAC,EAED,OACEM,EAAA,cAACC,EAAA,CAAc,GAAGH,CAAAA,EAChBE,EAAA,cAACZ,EAAA,CACC,aAAW,OACX,SAAUU,EAAQ,aAAaH,EAAUC,CAAO,EAC/C,GAAGC,GAEH,OAAOL,GAAa,WAAaA,EAASM,CAAO,EAAIN,CACxD,CACF,CAEJ,EAEAF,EAAK,YAAc"}
|
|
@@ -3,7 +3,6 @@ import type { Override } from '../../utilities';
|
|
|
3
3
|
export declare const StyledHeading: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<"h2", {
|
|
4
4
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
5
5
|
noCapsize?: boolean | "true" | undefined;
|
|
6
|
-
weight?: "bold" | "medium" | undefined;
|
|
7
6
|
}, {
|
|
8
7
|
sm: string;
|
|
9
8
|
md: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{styled as
|
|
1
|
+
import*as e from"react";import{styled as m}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import{capsize as i}from"../../utilities/style/capsize.js";import"color2k";import"../../utilities/style/keyframe-animations.js";const t=m("h2",{fontWeight:700,m:0,variants:{size:{xs:{fontFamily:"$body",fontSize:"$md",lineHeight:1.5,...i(.3864)},sm:{fontFamily:"$body",fontSize:"$lg",lineHeight:1.14,...i(.2078)},md:{fontFamily:"$body",fontSize:"$xl",lineHeight:1.14,...i(.2078)},lg:{fontFamily:"$display",fontSize:"$2xl",lineHeight:1.08,letterSpacing:"0.01em",...i(.1405,.2405)},xl:{fontFamily:"$display",fontSize:"$3xl",lineHeight:1.12,...i(.16,.26)},xxl:{fontFamily:"$display",fontSize:"$4xl",lineHeight:1,...i(.1,.2)}},noCapsize:{true:{"&::before, &::after":{display:"none !important"}}}}}),o=e.forwardRef(({size:n="md",...l},a)=>e.createElement(t,{ref:a,size:n,...l}));o.displayName="Heading";export{o as Heading,t as StyledHeading};
|
|
2
2
|
//# sourceMappingURL=Heading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","sources":["../../../src/components/heading/Heading.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport type { Override } from '~/utilities'\nimport { capsize } from '~/utilities'\n\nexport const StyledHeading = styled('h2', {\n m: 0,\n variants: {\n size: {\n xs: {\n fontFamily: '$body',\n fontSize: '$md',\n lineHeight: 1.5,\n ...capsize(0.3864)\n },\n sm: {\n fontFamily: '$body',\n fontSize: '$lg',\n lineHeight: 1.14,\n ...capsize(0.2078)\n },\n md: {\n fontFamily: '$body',\n fontSize: '$xl',\n lineHeight: 1.14,\n ...capsize(0.2078)\n },\n lg: {\n fontFamily: '$display',\n fontSize: '$2xl',\n lineHeight: 1.08,\n letterSpacing: '0.01em',\n ...capsize(0.1405, 0.2405)\n },\n xl: {\n fontFamily: '$display',\n fontSize: '$3xl',\n lineHeight: 1.12,\n ...capsize(0.16, 0.26)\n },\n xxl: {\n fontFamily: '$display',\n fontSize: '$4xl',\n lineHeight: 1,\n ...capsize(0.1, 0.2)\n }\n },\n noCapsize: {\n true: {\n '&::before, &::after': { display: 'none !important' }\n }\n }
|
|
1
|
+
{"version":3,"file":"Heading.js","sources":["../../../src/components/heading/Heading.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport type { Override } from '~/utilities'\nimport { capsize } from '~/utilities'\n\nexport const StyledHeading = styled('h2', {\n fontWeight: 700,\n m: 0,\n variants: {\n size: {\n xs: {\n fontFamily: '$body',\n fontSize: '$md',\n lineHeight: 1.5,\n ...capsize(0.3864)\n },\n sm: {\n fontFamily: '$body',\n fontSize: '$lg',\n lineHeight: 1.14,\n ...capsize(0.2078)\n },\n md: {\n fontFamily: '$body',\n fontSize: '$xl',\n lineHeight: 1.14,\n ...capsize(0.2078)\n },\n lg: {\n fontFamily: '$display',\n fontSize: '$2xl',\n lineHeight: 1.08,\n letterSpacing: '0.01em',\n ...capsize(0.1405, 0.2405)\n },\n xl: {\n fontFamily: '$display',\n fontSize: '$3xl',\n lineHeight: 1.12,\n ...capsize(0.16, 0.26)\n },\n xxl: {\n fontFamily: '$display',\n fontSize: '$4xl',\n lineHeight: 1,\n ...capsize(0.1, 0.2)\n }\n },\n noCapsize: {\n true: {\n '&::before, &::after': { display: 'none !important' }\n }\n }\n }\n})\n\nexport type HeadingProps = Override<\n React.ComponentProps<typeof StyledHeading>,\n {\n as?:\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | React.ComponentType\n | React.ElementType\n }\n>\n\nexport const Heading: React.ForwardRefExoticComponent<HeadingProps> =\n React.forwardRef(({ size = 'md', ...remainingProps }, ref) => (\n <StyledHeading ref={ref} size={size} {...remainingProps} />\n ))\n\nHeading.displayName = 'Heading'\n"],"names":["StyledHeading","styled","capsize","Heading","React","size","remainingProps","ref"],"mappings":"sTAMO,MAAMA,EAAgBC,EAAO,KAAM,CACxC,WAAY,IACZ,EAAG,EACH,SAAU,CACR,KAAM,CACJ,GAAI,CACF,WAAY,QACZ,SAAU,MACV,WAAY,IACZ,GAAGC,EAAQ,KAAM,CACnB,EACA,GAAI,CACF,WAAY,QACZ,SAAU,MACV,WAAY,KACZ,GAAGA,EAAQ,KAAM,CACnB,EACA,GAAI,CACF,WAAY,QACZ,SAAU,MACV,WAAY,KACZ,GAAGA,EAAQ,KAAM,CACnB,EACA,GAAI,CACF,WAAY,WACZ,SAAU,OACV,WAAY,KACZ,cAAe,SACf,GAAGA,EAAQ,MAAQ,KAAM,CAC3B,EACA,GAAI,CACF,WAAY,WACZ,SAAU,OACV,WAAY,KACZ,GAAGA,EAAQ,IAAM,GAAI,CACvB,EACA,IAAK,CACH,WAAY,WACZ,SAAU,OACV,WAAY,EACZ,GAAGA,EAAQ,GAAK,EAAG,CACrB,CACF,EACA,UAAW,CACT,KAAM,CACJ,sBAAuB,CAAE,QAAS,iBAAkB,CACtD,CACF,CACF,CACF,CAAC,EAiBYC,EACXC,EAAM,WAAW,CAAC,CAAE,KAAAC,EAAO,QAASC,CAAe,EAAGC,IACpDH,EAAA,cAACJ,EAAc,CAAA,IAAKO,EAAK,KAAMF,EAAO,GAAGC,CAAAA,CAAgB,CAC1D,EAEHH,EAAQ,YAAc"}
|