@accelint/design-toolkit 3.0.0 → 4.0.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/dist/components/accordion/styles.d.ts +1 -1
- package/dist/components/avatar/styles.d.ts +1 -1
- package/dist/components/badge/styles.d.ts +1 -1
- package/dist/components/button/styles.d.ts +3 -3
- package/dist/components/checkbox/styles.d.ts +1 -1
- package/dist/components/chip/styles.d.ts +4 -4
- package/dist/components/color-picker/styles.d.ts +1 -1
- package/dist/components/combobox-field/styles.d.ts +3 -3
- package/dist/components/date-field/index.d.ts +1 -3
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +41 -51
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/date-field/types.d.ts +12 -15
- package/dist/components/details-list/styles.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +28 -38
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/styles.d.ts +60 -0
- package/dist/components/dialog/styles.js +2 -0
- package/dist/components/dialog/styles.js.map +1 -0
- package/dist/components/dialog/types.d.ts +14 -0
- package/dist/components/dialog/types.js +2 -0
- package/dist/components/dialog/types.js.map +1 -0
- package/dist/components/hero/styles.d.ts +1 -1
- package/dist/components/hotkey/styles.d.ts +1 -1
- package/dist/components/icon/styles.d.ts +1 -1
- package/dist/components/input/styles.d.ts +1 -1
- package/dist/components/label/styles.d.ts +1 -1
- package/dist/components/menu/styles.d.ts +1 -1
- package/dist/components/options/styles.d.ts +3 -3
- package/dist/components/options/types.d.ts +1 -1
- package/dist/components/popover/styles.d.ts +1 -1
- package/dist/components/radio/styles.d.ts +1 -1
- package/dist/components/search-field/styles.d.ts +1 -1
- package/dist/components/select-field/styles.d.ts +4 -4
- package/dist/components/skeleton/styles.d.ts +1 -1
- package/dist/components/slider/index.d.ts +4 -43
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.d.ts +84 -0
- package/dist/components/slider/styles.js +2 -0
- package/dist/components/slider/styles.js.map +1 -0
- package/dist/components/slider/types.d.ts +22 -0
- package/dist/components/slider/types.js +2 -0
- package/dist/components/slider/types.js.map +1 -0
- package/dist/components/switch/styles.d.ts +1 -1
- package/dist/components/text-area-field/styles.d.ts +4 -4
- package/dist/components/text-field/styles.d.ts +4 -4
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +1 -1
- package/dist/index.css +3 -3
- package/dist/index.d.ts +9 -5
- package/dist/index.js +1 -1
- package/dist/lib/utils.d.ts +15 -5
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +503 -141
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/themes.css +12 -0
- package/dist/tokens/tokens.css +12 -0
- package/dist/variants/variants.css +13 -0
- package/package.json +14 -7
|
@@ -51,6 +51,6 @@ declare const AccordionStyles: tailwind_variants.TVReturnType<{
|
|
|
51
51
|
heading: string;
|
|
52
52
|
trigger: string[];
|
|
53
53
|
panel: string;
|
|
54
|
-
}, undefined, unknown, unknown
|
|
54
|
+
}, undefined, unknown, unknown>>;
|
|
55
55
|
|
|
56
56
|
export { AccordionStyles, AccordionStylesDefaults };
|
|
@@ -45,7 +45,7 @@ declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
45
45
|
icon: string[];
|
|
46
46
|
floating: string[];
|
|
47
47
|
};
|
|
48
|
-
}, undefined, string[], unknown, unknown
|
|
48
|
+
}, undefined, string[], unknown, unknown>>>;
|
|
49
49
|
declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
50
50
|
variant: {
|
|
51
51
|
filled: tailwind_merge.ClassNameValue | {};
|
|
@@ -86,7 +86,7 @@ declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
86
86
|
icon: string[];
|
|
87
87
|
floating: string[];
|
|
88
88
|
};
|
|
89
|
-
}, undefined, string[], unknown, unknown
|
|
89
|
+
}, undefined, string[], unknown, unknown>>>;
|
|
90
90
|
declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
91
91
|
variant: {
|
|
92
92
|
filled: string[];
|
|
@@ -124,6 +124,6 @@ declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
|
124
124
|
icon: string[];
|
|
125
125
|
floating: string[];
|
|
126
126
|
};
|
|
127
|
-
}, undefined, string[], unknown, unknown
|
|
127
|
+
}, undefined, string[], unknown, unknown>>>;
|
|
128
128
|
|
|
129
129
|
export { ButtonStyles, ButtonStylesDefaults, LinkButtonStyles, ToggleButtonStyles };
|
|
@@ -34,7 +34,7 @@ declare const BaseChipStyles: tailwind_variants.TVReturnType<{
|
|
|
34
34
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
35
35
|
list: string;
|
|
36
36
|
chip: string[];
|
|
37
|
-
}, undefined, unknown, unknown
|
|
37
|
+
}, undefined, unknown, unknown>>;
|
|
38
38
|
declare const ChipStyles: tailwind_variants.TVReturnType<{
|
|
39
39
|
variant: {
|
|
40
40
|
advisory: {
|
|
@@ -102,7 +102,7 @@ declare const ChipStyles: tailwind_variants.TVReturnType<{
|
|
|
102
102
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
103
103
|
list: string;
|
|
104
104
|
chip: string[];
|
|
105
|
-
}, undefined, unknown, unknown
|
|
105
|
+
}, undefined, unknown, unknown>>>;
|
|
106
106
|
declare const SelectableChipStyles: tailwind_variants.TVReturnType<{
|
|
107
107
|
[key: string]: {
|
|
108
108
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
@@ -170,7 +170,7 @@ declare const SelectableChipStyles: tailwind_variants.TVReturnType<{
|
|
|
170
170
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
171
171
|
list: string;
|
|
172
172
|
chip: string[];
|
|
173
|
-
}, undefined, unknown, unknown
|
|
173
|
+
}, undefined, unknown, unknown>>>;
|
|
174
174
|
declare const DeletableChipStyles: tailwind_variants.TVReturnType<{
|
|
175
175
|
[key: string]: {
|
|
176
176
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
@@ -242,6 +242,6 @@ declare const DeletableChipStyles: tailwind_variants.TVReturnType<{
|
|
|
242
242
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
243
243
|
list: string;
|
|
244
244
|
chip: string[];
|
|
245
|
-
}, undefined, unknown, unknown
|
|
245
|
+
}, undefined, unknown, unknown>>>;
|
|
246
246
|
|
|
247
247
|
export { BaseChipStyles, ChipStyles, ChipStylesDefaults, DeletableChipStyles, SelectableChipStyles };
|
|
@@ -4,12 +4,12 @@ import * as tailwind_merge from 'tailwind-merge';
|
|
|
4
4
|
declare const ComboBoxStyles: tailwind_variants.TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
+
description?: tailwind_merge.ClassNameValue;
|
|
7
8
|
input?: tailwind_merge.ClassNameValue;
|
|
8
9
|
label?: tailwind_merge.ClassNameValue;
|
|
9
10
|
popover?: tailwind_merge.ClassNameValue;
|
|
10
11
|
trigger?: tailwind_merge.ClassNameValue;
|
|
11
12
|
control?: tailwind_merge.ClassNameValue;
|
|
12
|
-
description?: tailwind_merge.ClassNameValue;
|
|
13
13
|
field?: tailwind_merge.ClassNameValue;
|
|
14
14
|
error?: tailwind_merge.ClassNameValue;
|
|
15
15
|
};
|
|
@@ -17,12 +17,12 @@ declare const ComboBoxStyles: tailwind_variants.TVReturnType<{
|
|
|
17
17
|
} | {
|
|
18
18
|
[x: string]: {
|
|
19
19
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
20
|
+
description?: tailwind_merge.ClassNameValue;
|
|
20
21
|
input?: tailwind_merge.ClassNameValue;
|
|
21
22
|
label?: tailwind_merge.ClassNameValue;
|
|
22
23
|
popover?: tailwind_merge.ClassNameValue;
|
|
23
24
|
trigger?: tailwind_merge.ClassNameValue;
|
|
24
25
|
control?: tailwind_merge.ClassNameValue;
|
|
25
|
-
description?: tailwind_merge.ClassNameValue;
|
|
26
26
|
field?: tailwind_merge.ClassNameValue;
|
|
27
27
|
error?: tailwind_merge.ClassNameValue;
|
|
28
28
|
};
|
|
@@ -39,12 +39,12 @@ declare const ComboBoxStyles: tailwind_variants.TVReturnType<{
|
|
|
39
39
|
}, undefined, {
|
|
40
40
|
[key: string]: {
|
|
41
41
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
42
|
+
description?: tailwind_merge.ClassNameValue;
|
|
42
43
|
input?: tailwind_merge.ClassNameValue;
|
|
43
44
|
label?: tailwind_merge.ClassNameValue;
|
|
44
45
|
popover?: tailwind_merge.ClassNameValue;
|
|
45
46
|
trigger?: tailwind_merge.ClassNameValue;
|
|
46
47
|
control?: tailwind_merge.ClassNameValue;
|
|
47
|
-
description?: tailwind_merge.ClassNameValue;
|
|
48
48
|
field?: tailwind_merge.ClassNameValue;
|
|
49
49
|
error?: tailwind_merge.ClassNameValue;
|
|
50
50
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { DateValue } from '@internationalized/date';
|
|
3
3
|
import { DateFieldProps } from './types.js';
|
|
4
|
-
import 'react';
|
|
5
4
|
import 'react-aria-components';
|
|
6
5
|
import 'tailwind-variants';
|
|
7
6
|
import './styles.js';
|
|
8
|
-
import 'tailwind-merge';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* DateField - A comprehensive date input component with segmented editing
|
|
@@ -51,6 +49,6 @@ import 'tailwind-merge';
|
|
|
51
49
|
* onChange={setSelectedDate}
|
|
52
50
|
* />
|
|
53
51
|
*/
|
|
54
|
-
declare function DateField<T extends DateValue>({ classNames, description: descriptionProp, errorMessage: errorMessageProp,
|
|
52
|
+
declare function DateField<T extends DateValue>({ classNames, description: descriptionProp, errorMessage: errorMessageProp, inputProps, label: labelProp, size, shortMonth, shouldForceLeadingZeros, isDisabled, isInvalid: isInvalidProp, isRequired, ...rest }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
|
|
55
53
|
|
|
56
54
|
export { DateField };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import x from'@accelint/icons/calendar';import {DateField,composeRenderProps,DateInput,DateSegment,Text,FieldError}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {DateFieldStyles,DateFieldStylesDefaults}from'./styles.js';const{field:q,label:D,control:B,input:G,segment:Y,description:Z,error:w}=DateFieldStyles(),z=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function $({classNames:i,description:d,errorMessage:A,inputProps:b,label:s,size:n="medium",shortMonth:t=DateFieldStylesDefaults.shortMonth,shouldForceLeadingZeros:y=true,isDisabled:N,isInvalid:m,isRequired:u,...T}){const p=A||null,c=n==="small";return jsx(DateField,{...T,className:composeRenderProps(i?.field,r=>q({className:r,shortMonth:t})),shouldForceLeadingZeros:y,isDisabled:N,isInvalid:m||(p?true:void 0),isRequired:u,"aria-label":s,"data-size":n,children:({isDisabled:r})=>jsxs(Fragment,{children:[!c&&D&&jsx(Label,{className:D({className:i?.label,shortMonth:t}),isDisabled:r,isRequired:u,children:s}),jsxs("div",{className:B({className:i?.control,shortMonth:t}),children:[n==="medium"&&jsx(Icon,{children:jsx(x,{})}),jsx(DateInput,{...b,className:composeRenderProps(i?.input,a=>G({className:a,shortMonth:t})),children:a=>a.type==="literal"?jsx(Fragment,{children:a.text===":"?":":null}):jsx(DateSegment,{className:composeRenderProps(i?.segment,o=>Y({className:o,shortMonth:t})),segment:a,children:({placeholder:o,text:I,value:S,isFocused:g,isPlaceholder:v})=>v?o:a.type==="month"&&t&&!g?z[(S??0)-1]:I})})]}),d&&(!(c||m)||r)&&jsx(Text,{className:Z({className:i?.description,shortMonth:t}),slot:"description",children:d}),jsx(FieldError,{className:composeRenderProps(i?.error,a=>w({className:a,shortMonth:t})),children:p})]})})}export{$ as DateField};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["control","input","description","DateFieldStyles","O","classNames","shortMonth","DateFieldStylesDefaults","k","shouldForceLeadingZeros","isInvalidProp","isRequired","isSmall","size","AriaDateField","rest","E","className","field","l","isDisabled","label","Label","f","e","V","labelProp","F","jsx","AriaDateInput","composeRenderProps","L","Fragment","segmentProp","DateSegment","C","placeholder","isFocused","months","descriptionProp","AriaText","error"],"mappings":"uWA6BsBA,KAAS,CAAA,CAAA,CAAAC,KAAO,CAAA,CAAA,CAAA,OAAS,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAa,OAAM,CAAA,CAChEC,YAGA,CACA,OACA,CAAA,CAAA,CAAA,CAAAC,eACA,EAAA,CAAA,CAAA,CAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KACF,CAAA,KA8CO,CAAA,MAAwC,KAC7C,CAAA,KAAA,CAAAC,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,0BAGA,CAAA,CAAA,CAAA,UAAO,CAAA,CAAA,CACP,KAAA,CAAA,CAAA,CAAA,IAAAC,CAAaC,CAAAA,CAAwB,mBACrC,CAAA,CAAA,CAAAC,uBAAA,CAAA,UAAA,CAAAC,8BAEWC,CAAAA,UACX,CAAA,CAAAC,CAAAA,SAGA,CAAA,CAAA,CAAA,UAAyC,CAAA,CACnCC,CAAAA,GA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AAA,IAAA,GAAAC,SAAqB,CAAAT,GAAA,CAAAD,QAAM,UAAW,CAIhDK,CAAAA,CAACM,IACC,GAAA,GAAA,CAAA,GAAWJ,CACTzB,IAAY,CAAA,CAAA,CAAAmB,GAAA,CAAAW,WAAA,CACXlB,CAAAA,SAAwB,CAAAE,kBAAA,CAAA,CAAA,EAAAF,OAAW,CAAA,CAAA,EAAA,CAAA,CAAAX,CAAW,SAEjD,CAAA,CAAA,CAAS2B,UAER,CAAA,CAAC,CACA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAAG,CAAAA,QAEA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,wBAISA,CAAAA,CAGFH,cAAqB,CAAA,CAAA,CAAA,GAC1B3B,CACA,CAAC+B,EACCC,CAAAA,CAAAA,IAAiB,GAAK,OAMpC,GACF,EACCC,CAAAA,CAAAA,CAAAA,CAAoB,EAAE3B,CAAAA,EAAWF,CAAAA,EAAAA,CAAkBU,CAAAA,CAAAA,CAAAA,CAClDQ,CAAAA,CAACY,EAAA,CACC,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,EAAWtC,CAAY,CACrB,eAAWG,CAAAA,SAAY,CAAA,CAAA,CAAA,CAAA,SACvB,CAAA,CAAA,EACF,sBAGC,CAAA,CAAA,CAAA,CAAA,CAAA,IAAAkC,CAAAA,aAIH,CAAA,QAA8BlC,CAAY,CAAA,CAAA,CAAA,CAAAmB,GAAA,CAAQP,UAAAA,CAAAA,CAChDwB,SAAQ,CAAAtB,kBAAA,CAAA,CAAAF,EAAW,KAAA,CAAA,CAAA,EAAA,CAAA,CAAAX,CAAW,sBAS5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport {\n DateField as AriaDateField,\n DateInput as AriaDateInput,\n Text as AriaText,\n DateSegment,\n FieldError,\n composeRenderProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { DateFieldStyles, DateFieldStylesDefaults } from './styles';\nimport type { DateFieldProps } from './types';\n\nconst { field, label, control, input, segment, description, error } =\n DateFieldStyles();\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\n/**\n * DateField - A comprehensive date input component with segmented editing\n *\n * Provides accessible date input functionality with separate segments for day,\n * month, and year. Includes calendar icon, validation states, and international\n * date format support with keyboard navigation between segments.\n *\n * @example\n * // Basic date field\n * <DateField label=\"Birth Date\" />\n *\n * @example\n * // Date field with validation\n * <DateField\n * label=\"Event Date\"\n * isRequired\n * isInvalid={hasError}\n * errorMessage=\"Please select a valid date\"\n * />\n *\n * @example\n * // Date field with custom formatting\n * <DateField\n * label=\"Meeting Date\"\n * shortMonth={false}\n * placeholder=\"Select meeting date\"\n * />\n *\n * @example\n * // Compact date field\n * <DateField\n * label=\"Due Date\"\n * size=\"small\"\n * description=\"When is this task due?\"\n * />\n *\n * @example\n * // Controlled date field\n * <DateField\n * label=\"Selected Date\"\n * value={selectedDate}\n * onChange={setSelectedDate}\n * />\n */\nexport function DateField<T extends DateValue>({\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n inputProps,\n label: labelProp,\n size = 'medium',\n shortMonth = DateFieldStylesDefaults.shortMonth,\n shouldForceLeadingZeros = true,\n isDisabled,\n isInvalid: isInvalidProp,\n isRequired,\n ...rest\n}: DateFieldProps<T>) {\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <AriaDateField<T>\n {...rest}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className, shortMonth }),\n )}\n shouldForceLeadingZeros={shouldForceLeadingZeros}\n isDisabled={isDisabled}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n isRequired={isRequired}\n aria-label={labelProp}\n data-size={size}\n >\n {(\n { isDisabled }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!isSmall && label && (\n <Label\n className={label({ className: classNames?.label, shortMonth })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <div\n className={control({ className: classNames?.control, shortMonth })}\n >\n {size === 'medium' && (\n <Icon>\n <Calendar />\n </Icon>\n )}\n <AriaDateInput\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({\n className,\n shortMonth,\n }),\n )}\n >\n {(segmentProp) => {\n // Remove extra space and punctuation from input display\n if (segmentProp.type === 'literal') {\n return <>{segmentProp.text === ':' ? ':' : null}</>;\n }\n\n return (\n <DateSegment\n className={composeRenderProps(\n classNames?.segment,\n (className) => segment({ className, shortMonth }),\n )}\n segment={segmentProp}\n >\n {({\n placeholder,\n text,\n value,\n isFocused,\n isPlaceholder,\n }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n return segmentProp.type === 'month' &&\n shortMonth &&\n !isFocused\n ? months[(value ?? 0) - 1]\n : text;\n }}\n </DateSegment>\n );\n }}\n </AriaDateInput>\n </div>\n {descriptionProp && (!(isSmall || isInvalidProp) || isDisabled) && (\n <AriaText\n className={description({\n className: classNames?.description,\n shortMonth,\n })}\n slot='description'\n >\n {descriptionProp}\n </AriaText>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className, shortMonth }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </AriaDateField>\n );\n}\n"]}
|
|
@@ -1,69 +1,59 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
-
import * as tailwind_merge from 'tailwind-merge';
|
|
3
2
|
|
|
4
|
-
declare const
|
|
5
|
-
readonly
|
|
3
|
+
declare const DateFieldStylesDefaults: {
|
|
4
|
+
readonly shortMonth: true;
|
|
6
5
|
};
|
|
7
6
|
declare const DateFieldStyles: tailwind_variants.TVReturnType<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
field?: tailwind_merge.ClassNameValue;
|
|
12
|
-
error?: tailwind_merge.ClassNameValue;
|
|
13
|
-
dateInputContainer?: tailwind_merge.ClassNameValue;
|
|
14
|
-
dateSegment?: tailwind_merge.ClassNameValue;
|
|
15
|
-
dateInput?: tailwind_merge.ClassNameValue;
|
|
16
|
-
descriptionText?: tailwind_merge.ClassNameValue;
|
|
7
|
+
shortMonth: {
|
|
8
|
+
true: {
|
|
9
|
+
segment: string[];
|
|
17
10
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[x: string]: {
|
|
21
|
-
[x: string]: tailwind_merge.ClassNameValue | {
|
|
22
|
-
icon?: tailwind_merge.ClassNameValue;
|
|
23
|
-
field?: tailwind_merge.ClassNameValue;
|
|
24
|
-
error?: tailwind_merge.ClassNameValue;
|
|
25
|
-
dateInputContainer?: tailwind_merge.ClassNameValue;
|
|
26
|
-
dateSegment?: tailwind_merge.ClassNameValue;
|
|
27
|
-
dateInput?: tailwind_merge.ClassNameValue;
|
|
28
|
-
descriptionText?: tailwind_merge.ClassNameValue;
|
|
11
|
+
false: {
|
|
12
|
+
segment: string[];
|
|
29
13
|
};
|
|
30
14
|
};
|
|
31
|
-
}
|
|
15
|
+
}, {
|
|
32
16
|
field: string;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
label: string;
|
|
18
|
+
control: string[];
|
|
19
|
+
input: string;
|
|
20
|
+
segment: string[];
|
|
21
|
+
description: string[];
|
|
37
22
|
error: string;
|
|
38
|
-
dateSegment: string;
|
|
39
23
|
}, undefined, {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
dateSegment?: tailwind_merge.ClassNameValue;
|
|
47
|
-
dateInput?: tailwind_merge.ClassNameValue;
|
|
48
|
-
descriptionText?: tailwind_merge.ClassNameValue;
|
|
24
|
+
shortMonth: {
|
|
25
|
+
true: {
|
|
26
|
+
segment: string[];
|
|
27
|
+
};
|
|
28
|
+
false: {
|
|
29
|
+
segment: string[];
|
|
49
30
|
};
|
|
50
31
|
};
|
|
51
|
-
}
|
|
32
|
+
}, {
|
|
52
33
|
field: string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
label: string;
|
|
35
|
+
control: string[];
|
|
36
|
+
input: string;
|
|
37
|
+
segment: string[];
|
|
38
|
+
description: string[];
|
|
57
39
|
error: string;
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
}, tailwind_variants.TVReturnType<{
|
|
41
|
+
shortMonth: {
|
|
42
|
+
true: {
|
|
43
|
+
segment: string[];
|
|
44
|
+
};
|
|
45
|
+
false: {
|
|
46
|
+
segment: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
60
50
|
field: string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
label: string;
|
|
52
|
+
control: string[];
|
|
53
|
+
input: string;
|
|
54
|
+
segment: string[];
|
|
55
|
+
description: string[];
|
|
65
56
|
error: string;
|
|
66
|
-
dateSegment: string;
|
|
67
57
|
}, undefined, unknown, unknown, undefined>>;
|
|
68
58
|
|
|
69
|
-
export { DateFieldStyles,
|
|
59
|
+
export { DateFieldStyles, DateFieldStylesDefaults };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'tailwind-variants';const t={
|
|
1
|
+
import {tv}from'tailwind-variants';const t={shortMonth:true},l=tv({slots:{field:"group/date-field flex flex-col gap-xs",label:"",control:["flex w-full items-center gap-xs rounded-medium px-s py-xs font-display outline outline-interactive","group-size-medium/date-field:text-body-s","group-size-small/date-field:text-body-xs","text-default-light","hover:outline-interactive-hover","focus-visible-within:outline-highlight","group-invalid/date-field:outline-serious","group-disabled/date-field:text-disabled group-disabled/date-field:outline-interactive-disabled group-disabled/date-field:placeholder:text-disabled"],input:"flex gap-xs",segment:["text-right","placeholder-shown:text-default-dark","focus-visible:bg-highlight focus-visible:text-inverse-light focus-visible:outline-none"],description:["fg-default-dark text-body-xs","group-disabled/date-field:fg-disabled"],error:"fg-serious text-body-xs"},variants:{shortMonth:{true:{segment:["group-size-medium/date-field:type-month:w-[calc(3ch+(3*var(--typography-body-s-spacing)))]","group-size-small/date-field:type-month:w-[calc(3ch+(3*var(--typography-body-xs-spacing)))]"]},false:{segment:["group-size-medium/date-field:type-month:w-[calc(2ch+(2*var(--typography-body-s-spacing)))]","group-size-small/date-field:type-month:w-[calc(2ch+(2*var(--typography-body-xs-spacing)))]"]}}},defaultVariants:t});export{l as DateFieldStyles,t as DateFieldStylesDefaults};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/date-field/styles.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/date-field/styles.ts"],"names":["DateFieldStylesDefaults","DateFieldStyles","tv"],"mappings":"mCAcO,MAAMA,EAA0B,CACrC,UAAA,CAAY,IACd,CAAA,CAEaC,CAAAA,CAAkBC,EAAAA,CAAG,CAChC,KAAA,CAAO,CACL,KAAA,CAAO,uCAAA,CACP,KAAA,CAAO,EAAA,CACP,OAAA,CAAS,CACP,oGAAA,CACA,0CAAA,CACA,2CACA,oBAAA,CACA,iCAAA,CACA,wCAAA,CACA,0CAAA,CACA,oJACF,CAAA,CACA,KAAA,CAAO,aAAA,CACP,QAAS,CACP,YAAA,CACA,qCAAA,CACA,wFACF,CAAA,CACA,WAAA,CAAa,CACX,8BAAA,CACA,uCACF,CAAA,CACA,KAAA,CAAO,yBACT,CAAA,CACA,QAAA,CAAU,CACR,UAAA,CAAY,CACV,KAAM,CACJ,OAAA,CAAS,CACP,4FAAA,CACA,4FACF,CACF,CAAA,CACA,KAAA,CAAO,CACL,OAAA,CAAS,CACP,4FAAA,CACA,4FACF,CACF,CACF,CACF,CAAA,CACA,eAAA,CAAiBF,CACnB,CAAC","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from 'tailwind-variants';\n\nexport const DateFieldStylesDefaults = {\n shortMonth: true,\n} as const;\n\nexport const DateFieldStyles = tv({\n slots: {\n field: 'group/date-field flex flex-col gap-xs',\n label: '',\n control: [\n 'flex w-full items-center gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n 'group-size-medium/date-field:text-body-s',\n 'group-size-small/date-field:text-body-xs',\n 'text-default-light',\n 'hover:outline-interactive-hover',\n 'focus-visible-within:outline-highlight',\n 'group-invalid/date-field:outline-serious',\n 'group-disabled/date-field:text-disabled group-disabled/date-field:outline-interactive-disabled group-disabled/date-field:placeholder:text-disabled',\n ],\n input: 'flex gap-xs',\n segment: [\n 'text-right',\n 'placeholder-shown:text-default-dark',\n 'focus-visible:bg-highlight focus-visible:text-inverse-light focus-visible:outline-none',\n ],\n description: [\n 'fg-default-dark text-body-xs',\n 'group-disabled/date-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs',\n },\n variants: {\n shortMonth: {\n true: {\n segment: [\n 'group-size-medium/date-field:type-month:w-[calc(3ch+(3*var(--typography-body-s-spacing)))]',\n 'group-size-small/date-field:type-month:w-[calc(3ch+(3*var(--typography-body-xs-spacing)))]',\n ],\n },\n false: {\n segment: [\n 'group-size-medium/date-field:type-month:w-[calc(2ch+(2*var(--typography-body-s-spacing)))]',\n 'group-size-small/date-field:type-month:w-[calc(2ch+(2*var(--typography-body-xs-spacing)))]',\n ],\n },\n },\n },\n defaultVariants: DateFieldStylesDefaults,\n});\n"]}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DateValue, DateFieldProps as DateFieldProps$1, DateInputProps as DateInputProps$1, LabelProps, FieldErrorProps } from 'react-aria-components';
|
|
1
|
+
import { DateValue, DateFieldProps as DateFieldProps$1, LabelProps, DateInputProps, DateSegmentProps, FieldErrorProps } from 'react-aria-components';
|
|
3
2
|
import { VariantProps } from 'tailwind-variants';
|
|
4
3
|
import { DateFieldStyles } from './styles.js';
|
|
5
|
-
import 'tailwind-merge';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
ref?: ForwardedRef<HTMLDivElement>;
|
|
9
|
-
size?: 'small' | 'medium';
|
|
10
|
-
isInvalid?: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface DateFieldProps<T extends DateValue> extends VariantProps<typeof DateFieldStyles>, Omit<DateFieldProps$1<T>, 'style' | 'className'>, Omit<DateInputProps$1, 'children' | 'style'> {
|
|
5
|
+
type DateFieldProps<T extends DateValue> = Omit<DateFieldProps$1<T>, 'children' | 'className' | 'placeholder'> & VariantProps<typeof DateFieldStyles> & {
|
|
13
6
|
classNames?: {
|
|
14
7
|
field?: DateFieldProps$1<T>['className'];
|
|
15
8
|
label?: LabelProps['className'];
|
|
9
|
+
control?: string;
|
|
16
10
|
input?: DateInputProps['className'];
|
|
11
|
+
segment?: DateSegmentProps['className'];
|
|
17
12
|
description?: string;
|
|
18
13
|
error?: FieldErrorProps['className'];
|
|
19
14
|
};
|
|
20
|
-
|
|
15
|
+
label?: string;
|
|
21
16
|
description?: string;
|
|
22
17
|
errorMessage?: string;
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
inputProps?: Omit<DateInputProps, 'children' | 'className'>;
|
|
19
|
+
/**
|
|
20
|
+
* When true, will convert month value to 3 letter abbreviation when not editing
|
|
21
|
+
*/
|
|
25
22
|
shortMonth?: boolean;
|
|
26
|
-
|
|
27
|
-
}
|
|
23
|
+
size?: 'small' | 'medium';
|
|
24
|
+
};
|
|
28
25
|
|
|
29
|
-
export type { DateFieldProps
|
|
26
|
+
export type { DateFieldProps };
|
|
@@ -60,6 +60,6 @@ declare const DetailsListStyles: tailwind_variants.TVReturnType<{
|
|
|
60
60
|
list: string;
|
|
61
61
|
label: string;
|
|
62
62
|
value: string;
|
|
63
|
-
}, undefined, unknown, unknown
|
|
63
|
+
}, undefined, unknown, unknown>>;
|
|
64
64
|
|
|
65
65
|
export { DetailsListStyles, DetailsListStylesDefaults };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { RefObject, PropsWithChildren, ReactNode } from 'react';
|
|
3
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
import '../button/styles.js';
|
|
9
|
-
import 'tailwind-merge';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { DialogTrigger, HeadingProps, ContextValue } from 'react-aria-components';
|
|
5
|
+
import { DialogProps } from './types.js';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
declare const DialogContext: react.Context<ContextValue<DialogProps, HTMLDivElement>>;
|
|
8
|
+
declare function DialogTitle({ children, className }: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare namespace DialogTitle {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
declare function DialogContent({ children, className }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare namespace DialogContent {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
declare function DialogFooter({ children, className }: ComponentProps<'footer'>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare namespace DialogFooter {
|
|
18
|
+
var displayName: string;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Dialog - A modal dialog component for important content and interactions
|
|
@@ -26,9 +26,9 @@ interface DialogProps extends DialogTriggerProps {
|
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* // Basic dialog with trigger
|
|
29
|
-
* <Dialog>
|
|
29
|
+
* <Dialog.Trigger>
|
|
30
30
|
* <Button>Open Dialog</Button>
|
|
31
|
-
* <Dialog
|
|
31
|
+
* <Dialog>
|
|
32
32
|
* {({ close }) => (
|
|
33
33
|
* <>
|
|
34
34
|
* <Dialog.Title>Confirm Action</Dialog.Title>
|
|
@@ -38,26 +38,16 @@ interface DialogProps extends DialogTriggerProps {
|
|
|
38
38
|
* </Dialog.Footer>
|
|
39
39
|
* </>
|
|
40
40
|
* )}
|
|
41
|
-
* </Dialog
|
|
42
|
-
* </Dialog>
|
|
41
|
+
* </Dialog>
|
|
42
|
+
* </Dialog.Trigger>
|
|
43
43
|
*/
|
|
44
|
-
declare
|
|
45
|
-
|
|
46
|
-
displayName: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Footer: ({ children, className, }: PropsWithChildren<{
|
|
52
|
-
className?: string;
|
|
53
|
-
}>) => react_jsx_runtime.JSX.Element;
|
|
54
|
-
Title: ({ children, className, }: PropsWithChildren<{
|
|
55
|
-
className?: string;
|
|
56
|
-
}>) => react_jsx_runtime.JSX.Element;
|
|
57
|
-
Body: react.ForwardRefExoticComponent<DialogBodyProps & react.RefAttributes<HTMLDivElement>>;
|
|
58
|
-
};
|
|
59
|
-
interface DialogBodyProps {
|
|
60
|
-
children: ReactNode | ReactNode[] | ((opts: DialogRenderProps) => ReactNode);
|
|
44
|
+
declare function Dialog({ ref, ...props }: DialogProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
declare namespace Dialog {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
var Trigger: typeof DialogTrigger;
|
|
48
|
+
var Title: typeof DialogTitle;
|
|
49
|
+
var Content: typeof DialogContent;
|
|
50
|
+
var Footer: typeof DialogFooter;
|
|
61
51
|
}
|
|
62
52
|
|
|
63
|
-
export { Dialog,
|
|
53
|
+
export { Dialog, DialogContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import {UNSAFE_PortalProvider}from'@react-aria/overlays';import {useIsSSR}from'@react-aria/ssr';import {createContext,useState,useEffect,useContext}from'react';import {useContextProps,ModalOverlay,composeRenderProps,Modal,Dialog,DialogTrigger,Heading,OverlayTriggerStateContext}from'react-aria-components';import {ButtonContext}from'../button/index.js';import {DialogStyles}from'./styles.js';const {overlay:h,modal:B,dialog:U,title:_,content:I,footer:L}=DialogStyles(),d=createContext(null);function g({children:e,className:o}){return jsx(Heading,{slot:"title",className:_({className:o}),children:e})}g.displayName="Dialog.Title";function f({children:e,className:o}){return jsx("div",{className:I({className:o}),children:e})}f.displayName="Dialog.Content";function P({children:e,className:o}){const a=useContext(d),s=(isSlottedContextValue(a)?null:a?.size)??"small",n=useContext(OverlayTriggerStateContext);return jsx("footer",{className:L({className:o}),children:jsx(ButtonContext.Provider,{value:{size:s,onPress:n?.close??(()=>{})},children:e})})}P.displayName="Dialog.Footer";function r({ref:e,...o}){[o,e]=useContextProps(o,e??null,d);const a=useIsSSR(),[s,n]=useState(a?null:document.body),{children:v,classNames:m,parentRef:c,size:C="small",...D}=o;return useEffect(()=>{const l=c?.current,i=a?null:document.createElement("div");return l&&i&&(l.appendChild(i),n(i)),()=>{i?.remove(),n(a?null:document.body);}},[a,c]),jsx(d.Provider,{value:o,children:jsx(UNSAFE_PortalProvider,{getContainer:()=>s,children:jsx(ModalOverlay,{...D,ref:e,className:composeRenderProps(m?.overlay,l=>h({className:l})),"data-size":C,children:jsx(Modal,{className:composeRenderProps(m?.modal,l=>B({className:l})),children:jsx(Dialog,{className:U({className:m?.dialog}),children:v})})})})})}r.displayName="Dialog",r.Trigger=DialogTrigger,r.Title=g,r.Content=f,r.Footer=P;export{r as Dialog,d as DialogContext};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/dialog/index.tsx"],"names":["useDialogContext","h","ctx","DialogContext","z","size","jsx","RACDialogTrigger","s","isDismissable","Dialog","rest","v","ref","useState","isSSR","N","node","P","port","setPortal","parentRef","RACModalOverlay","cn","n","O","children","DialogContent","S","dialogSize","buttonSize","buttonSizes","Button","w","DialogFooter","DialogTitle","DialogBody"],"mappings":"qcA4CQ,CAAI,oEACA,CAAA,EAAA,CAAA,gDAGJ,CAAA,CAAA,iBAOF,IAAA,CAAA,IACJ,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACN,CAAA,OAa0D,CAAA,EAAA,CAAM,QAE1DA,CAAmB,CAAA,CAAA,CAAAC,aAAM,CAC7B,CAAA,IAAA,CAAMC,IAAiBC,CAAa,CAAA,CACpC,CAAA,CAAA,IACE,CAAA,MAAM,CAAA,CAAAC,UAAI,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,CAAA,CAAA,MAA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GAAA,IAAA,EAAA,oBASJ,CAAC,CAAE,CAAA,CAAA,QAAAE,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAuC,SAC/D,CAAA,CAAA,CAAMG,GAAe7B,EAAiB,GACxC8B,CAAaC,KACnB,CAAA,IAAA,CAAA,CACEzB,CAAAA,CAAC0B,CAAAA,EACC,CAAA,CAAA,CAAA,CAAA,CAAMF,CAAAA,CACL,CAAA,OAGDtB,GAAA,CAAAyB,MAAA,CAAA,CAAA,IAAc,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SAAA,CAAAT,EAAA,CAAA,oBAOC,CAAC,CACpB,CAAA,CAAA,QAAAE,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAEA,CAAA,CAAA,CAAA,UAAiB1B,CAAAA,CAAiB,GAClC,CAAA,KACEM,CAAAA,IAAC,CAAA,CAAA,CAAA,CACC,CAAA,EAAA,CAAA,UACE,CAAA,KAAA,CAAA,CAAA,SAAA,CAAAkB,EAAA,CAAA,yBAEAnB,CAAAA,CAAS,GAAA,YAEX,CAAA,CAEC,GAAA,IAAA,EAAAqB,OAKA,CAAA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAUC,CAAAA,MACV,CAAA,CAAA,CAAA,CAASO,CAAAA,OACT,CAAA,CAAQC,CAAAA,CACfzB,CAAAA,MAAc0B,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport { useIsSSR } from '@react-aria/ssr';\nimport 'client-only';\nimport { cva } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type RefObject,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n type DialogRenderProps,\n type DialogTriggerProps,\n Dialog as RACDialog,\n DialogTrigger as RACDialogTrigger,\n Heading as RACHeading,\n Modal as RACModal,\n ModalOverlay as RACModalOverlay,\n} from 'react-aria-components';\nimport { Button } from '../button';\nimport type { ButtonProps } from '../button/types';\n\nconst dialogClasses = cva(\n 'flex flex-col align-end font-light text-body-m text-default-dark',\n {\n variants: {\n size: {\n sm: 'min-w-[280px] max-w-[280px] rounded-medium p-l',\n lg: 'min-w-[320px] max-w-[720px] rounded-large p-xl',\n },\n defaultVariants: {\n size: 'sm',\n },\n },\n },\n);\n\nconst buttonSizes: Record<string, ButtonProps['size']> = {\n sm: 'small',\n lg: 'medium',\n};\n\ntype DialogSize = 'sm' | 'lg';\n\ninterface DialogContextValue {\n size: DialogSize;\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n parentRef?: RefObject<HTMLElement | null>;\n}\n\nconst DialogContext = createContext<DialogContextValue>({ size: 'sm' });\n\nconst useDialogContext = () => {\n const ctx = useContext(DialogContext);\n if (!ctx) {\n throw new Error('Dialog components must be used within <Dialog>');\n }\n return ctx;\n};\n\nexport interface DialogProps extends DialogTriggerProps {\n size?: DialogSize;\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n parentRef?: RefObject<HTMLElement | null>;\n}\n\n/**\n * Dialog - A modal dialog component for important content and interactions\n *\n * Provides accessible modal functionality with focus management, backdrop handling,\n * and keyboard navigation. Supports multiple sizes and customizable dismissal behavior.\n * Perfect for confirmations, forms, or any content requiring user focus.\n *\n * @example\n * // Basic dialog with trigger\n * <Dialog>\n * <Button>Open Dialog</Button>\n * <Dialog.Body>\n * {({ close }) => (\n * <>\n * <Dialog.Title>Confirm Action</Dialog.Title>\n * <p>Are you sure you want to continue?</p>\n * <Dialog.Footer>\n * <Dialog.Button onPress={close}>Confirm</Dialog.Button>\n * </Dialog.Footer>\n * </>\n * )}\n * </Dialog.Body>\n * </Dialog>\n */\nexport const Dialog = ({\n children,\n size,\n isOpen,\n onOpenChange,\n isDismissable = true,\n isKeyboardDismissDisabled = true,\n parentRef,\n}: DialogProps) => {\n return (\n <RACDialogTrigger>\n <DialogContext.Provider\n value={{\n size: size ?? 'sm',\n isDismissable,\n isOpen,\n onOpenChange,\n parentRef,\n isKeyboardDismissDisabled,\n }}\n >\n {children}\n </DialogContext.Provider>\n </RACDialogTrigger>\n );\n};\nDialog.displayName = 'Dialog';\n\ninterface DialogBodyProps {\n children: ReactNode | ReactNode[] | ((opts: DialogRenderProps) => ReactNode);\n}\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(\n ({ children, ...rest }, ref) => {\n const {\n size,\n isDismissable,\n isOpen,\n onOpenChange,\n parentRef,\n isKeyboardDismissDisabled,\n } = useDialogContext();\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n useEffect(() => {\n const node = parentRef?.current;\n /* Ensure proper ssr hydration TODO */\n const port = isSSR ? null : document.createElement('div');\n\n if (node && port) {\n node.appendChild(port);\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef]);\n\n return portal ? (\n <RACModalOverlay\n UNSTABLE_portalContainer={portal}\n isKeyboardDismissDisabled={!isDismissable && isKeyboardDismissDisabled}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n isDismissable={isDismissable}\n className='absolute inset-0 flex items-center justify-center'\n {...rest}\n >\n <RACModal\n ref={ref}\n className={cn(\n 'flex flex-col justify-center bg-surface-overlay align-start',\n size === 'sm' && 'rounded-medium',\n size === 'lg' && 'rounded-large',\n )}\n >\n <RACDialog className={dialogClasses({ size })}>{children}</RACDialog>\n </RACModal>\n </RACModalOverlay>\n ) : null;\n },\n);\nDialogBody.displayName = 'DialogBody';\n\nconst DialogContent = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <div\n className={cn(\n 'flex flex-col',\n size === 'sm' && 'gap-xs',\n size === 'lg' && 'gap-l',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n\nconst DialogTitle = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <RACHeading\n slot='title'\n className={cn(\n 'text-default-light',\n size === 'sm' && 'mb-s text-header-m',\n size === 'lg' && 'mb-m text-header-l',\n className,\n )}\n >\n {children}\n </RACHeading>\n );\n};\n\nconst DialogButton = ({ children, className, ...props }: ButtonProps) => {\n const { size: dialogSize } = useDialogContext();\n const buttonSize = buttonSizes[dialogSize];\n return (\n <Button\n size={buttonSize}\n {...props}\n //overriding the style to deal with rac's pressed state inherited\n //from the trigger state\n className={cn('pressed:bg-initial', className)}\n >\n {children}\n </Button>\n );\n};\n\nconst DialogFooter = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <div\n className={cn(\n 'flex justify-end gap-xs',\n size === 'sm' && 'mt-l',\n size === 'lg' && 'mt-xl',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n\nDialog.Button = DialogButton;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Title = DialogTitle;\nDialog.Body = DialogBody;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/dialog/index.tsx"],"names":["title","DialogStyles","DialogContext","DialogTitle","S","className","jsx","Heading","t","M","children","DialogContent","context","useContext","y","state","p","R","size","DialogFooter","props","ref","isSSR","useIsSSR","portal","x","E","classNames","parentRef","useEffect","node","T","port","setPortal","N","rest","composeRenderProps","modal","u","dialog","F","Dialog"],"mappings":"yfAwCwB,MAAA,CAAA,SAAQA,CAAAA,KAAO,CAAA,CAAA,CAAA,MAAS,CAAA,CAAA,CAAA,KAAWC,CAAa,EAE3DC,QACkD,CAAA,CAE/D,MAAA,CAAA,CAAA,CAASC,aAAY,EAAE,CAAA,CAAA,CAAAC,aAAA,CAAA,MAAU,SAAAC,CAAU,EAAiB,QAExDC,EAACC,CAAAA,SAAa,CAAA,CAAA,CAAA,CAAA,CAAA,OAAQC,GAAA,CAAAC,OAAA,CAAWT,CAAAA,YAAQK,CAAU,SAChD,CAAA,CAAA,CAAAK,CAAAA,SAIK,CAAA,CAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,YAEjBC,cAA0B,CAAA,SAAAN,CAAU,CAAA,CAA0B,QAC9DC,CAAAA,CAAC,UAAI,CAAA,CAAA,CAAA,CAAA,CAAA,OAAqBE,GAAA,CAAA,KAAA,CAAAH,CAAU,SAAK,CAAA,CAAA,CAAAK,UAEpC,CAAA,CAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,4BAEM,CAAA,SAAAL,CAAU,CAAA,CAA6B,QACjEO,CAAUC,EAAWX,SAEK,EAAI,CAAA,CAAA,CAAA,qBAAyB,CAAA,CAAA,CAAA,CAAAY,qBAAA,CAAA,CAAA,CACvDC,CAAAA,IAA6C,CAAA,CAEnD,SACG,OAAA,CAAA,CAAA,CAAOC,UAAA,CAAAC,0BAAA,CAAA,CAAA,OAAkBT,GAAE,CAAA,QAAA,CAAAH,CAAU,SACpC,CAAA,CAAA,CAAAC,UAAe,CAAA,CAAA,CAAd,CACC,CAAA,aACEY,aAAAA,CACA,QAASH,OAAO,CAAA,CAAA,IAAU,CAAA,C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AA,WACE,CAAA,CAAA,CAAW8B,aAAuC/B,KAAAA,CAAAA,CAChDgC,SAAQ,CAAAC,kBAAA,CAAA,CAAAjC,EAAW,YAGrBC,SAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAWiC,QAAS,CAAA/B,GAAA,CAAAgC,MAAA,CAAWb,CAAAA,SAAoB,CAAA,CAC5D,CAAA,CAAA,SACH,EACF,EACF,MAKRc,EAAO,CAAA,QAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACrBA,EAAO,CAAA,WACA,CAAA,SACA,CAAA,CAAA,OAAU9B,CACjB8B,cAAO,CAAA,CAAA,KAAStB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { UNSAFE_PortalProvider } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport {\n type ComponentProps,\n createContext,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n Dialog as AriaDialog,\n type ContextValue,\n DialogTrigger,\n Heading,\n type HeadingProps,\n Modal,\n ModalOverlay,\n OverlayTriggerStateContext,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { ButtonContext } from '../button';\nimport { DialogStyles } from './styles';\nimport type { DialogProps } from './types';\n\nconst { overlay, modal, dialog, title, content, footer } = DialogStyles();\n\nexport const DialogContext =\n createContext<ContextValue<DialogProps, HTMLDivElement>>(null);\n\nfunction DialogTitle({ children, className }: HeadingProps) {\n return (\n <Heading slot='title' className={title({ className })}>\n {children}\n </Heading>\n );\n}\nDialogTitle.displayName = 'Dialog.Title';\n\nfunction DialogContent({ children, className }: ComponentProps<'div'>) {\n return <div className={content({ className })}>{children}</div>;\n}\nDialogContent.displayName = 'Dialog.Content';\n\nfunction DialogFooter({ children, className }: ComponentProps<'footer'>) {\n const context = useContext(DialogContext);\n const size =\n (isSlottedContextValue(context) ? null : context?.size) ?? 'small';\n const state = useContext(OverlayTriggerStateContext);\n\n return (\n <footer className={footer({ className })}>\n <ButtonContext.Provider\n value={{\n size,\n onPress: state?.close ?? (() => undefined),\n }}\n >\n {children}\n </ButtonContext.Provider>\n </footer>\n );\n}\n\nDialogFooter.displayName = 'Dialog.Footer';\n\n/**\n * Dialog - A modal dialog component for important content and interactions\n *\n * Provides accessible modal functionality with focus management, backdrop handling,\n * and keyboard navigation. Supports multiple sizes and customizable dismissal behavior.\n * Perfect for confirmations, forms, or any content requiring user focus.\n *\n * @example\n * // Basic dialog with trigger\n * <Dialog.Trigger>\n * <Button>Open Dialog</Button>\n * <Dialog>\n * {({ close }) => (\n * <>\n * <Dialog.Title>Confirm Action</Dialog.Title>\n * <p>Are you sure you want to continue?</p>\n * <Dialog.Footer>\n * <Dialog.Button onPress={close}>Confirm</Dialog.Button>\n * </Dialog.Footer>\n * </>\n * )}\n * </Dialog>\n * </Dialog.Trigger>\n */\nexport function Dialog({ ref, ...props }: DialogProps) {\n [props, ref] = useContextProps(props, ref ?? null, DialogContext);\n\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n const { children, classNames, parentRef, size = 'small', ...rest } = props;\n\n useEffect(() => {\n const node = parentRef?.current;\n // TODO: Ensure proper ssr hydration\n const port = isSSR ? null : document.createElement('div');\n\n if (node && port) {\n node.appendChild(port);\n\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef]);\n\n return (\n <DialogContext.Provider value={props}>\n <UNSAFE_PortalProvider getContainer={() => portal}>\n <ModalOverlay\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.overlay, (className) =>\n overlay({ className }),\n )}\n data-size={size}\n >\n <Modal\n className={composeRenderProps(classNames?.modal, (className) =>\n modal({ className }),\n )}\n >\n <AriaDialog className={dialog({ className: classNames?.dialog })}>\n {children}\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n </UNSAFE_PortalProvider>\n </DialogContext.Provider>\n );\n}\nDialog.displayName = 'Dialog';\nDialog.Trigger = DialogTrigger;\nDialog.Title = DialogTitle;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\n"]}
|