@d4gger/design-system 4.0.1 → 4.0.2
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/_internal/props/propDef.cjs +2 -1
- package/dist/_internal/props/propDef.cjs.map +2 -2
- package/dist/_internal/props/propDef.d.cts.map +1 -1
- package/dist/_internal/props/propDef.d.mts.map +1 -1
- package/dist/_internal/props/propDef.d.ts.map +1 -1
- package/dist/_internal/props/propDef.js +2 -1
- package/dist/_internal/props/propDef.js.map +2 -2
- package/dist/components/alert.css +12 -0
- package/dist/components/box.css +0 -12
- package/dist/components/config-drawer.css +9 -1
- package/dist/components/configDrawer/ConfigDrawer.cjs +1 -0
- package/dist/components/configDrawer/ConfigDrawer.cjs.map +2 -2
- package/dist/components/configDrawer/ConfigDrawer.d.cts.map +1 -1
- package/dist/components/configDrawer/ConfigDrawer.d.mts.map +1 -1
- package/dist/components/configDrawer/ConfigDrawer.d.ts.map +1 -1
- package/dist/components/configDrawer/ConfigDrawer.js +1 -0
- package/dist/components/configDrawer/ConfigDrawer.js.map +2 -2
- package/dist/components/drawer.css +4 -2
- package/dist/components/flex/Flex.cjs +5 -4
- package/dist/components/flex/Flex.cjs.map +2 -2
- package/dist/components/flex/Flex.d.cts.map +1 -1
- package/dist/components/flex/Flex.d.mts.map +1 -1
- package/dist/components/flex/Flex.d.ts.map +1 -1
- package/dist/components/flex/Flex.js +5 -4
- package/dist/components/flex/Flex.js.map +2 -2
- package/dist/components/grid/Grid.cjs +5 -5
- package/dist/components/grid/Grid.cjs.map +2 -2
- package/dist/components/grid/Grid.d.cts.map +1 -1
- package/dist/components/grid/Grid.d.mts.map +1 -1
- package/dist/components/grid/Grid.d.ts.map +1 -1
- package/dist/components/grid/Grid.js +5 -5
- package/dist/components/grid/Grid.js.map +2 -2
- package/dist/components/input-otp.css +24 -0
- package/dist/components/inputOtp/InputOtp.cjs +2 -1
- package/dist/components/inputOtp/InputOtp.cjs.map +2 -2
- package/dist/components/inputOtp/InputOtp.d.cts +8 -0
- package/dist/components/inputOtp/InputOtp.d.cts.map +1 -1
- package/dist/components/inputOtp/InputOtp.d.mts +8 -0
- package/dist/components/inputOtp/InputOtp.d.mts.map +1 -1
- package/dist/components/inputOtp/InputOtp.d.ts +8 -0
- package/dist/components/inputOtp/InputOtp.d.ts.map +1 -1
- package/dist/components/inputOtp/InputOtp.js +2 -1
- package/dist/components/inputOtp/InputOtp.js.map +2 -2
- package/dist/components/inputOtp/inputOtp.props.cjs +4 -0
- package/dist/components/inputOtp/inputOtp.props.cjs.map +2 -2
- package/dist/components/inputOtp/inputOtp.props.d.cts +4 -0
- package/dist/components/inputOtp/inputOtp.props.d.cts.map +1 -1
- package/dist/components/inputOtp/inputOtp.props.d.mts +4 -0
- package/dist/components/inputOtp/inputOtp.props.d.mts.map +1 -1
- package/dist/components/inputOtp/inputOtp.props.d.ts +4 -0
- package/dist/components/inputOtp/inputOtp.props.d.ts.map +1 -1
- package/dist/components/inputOtp/inputOtp.props.js +4 -0
- package/dist/components/inputOtp/inputOtp.props.js.map +2 -2
- package/dist/components/link.css +21 -0
- package/dist/components/rich-text-editor.css +2 -0
- package/dist/components/richTextEditor/EditorTools.cjs +98 -44
- package/dist/components/richTextEditor/EditorTools.cjs.map +2 -2
- package/dist/components/richTextEditor/EditorTools.d.cts +51 -1
- package/dist/components/richTextEditor/EditorTools.d.cts.map +1 -1
- package/dist/components/richTextEditor/EditorTools.d.mts +51 -1
- package/dist/components/richTextEditor/EditorTools.d.mts.map +1 -1
- package/dist/components/richTextEditor/EditorTools.d.ts +51 -1
- package/dist/components/richTextEditor/EditorTools.d.ts.map +1 -1
- package/dist/components/richTextEditor/EditorTools.js +98 -44
- package/dist/components/richTextEditor/EditorTools.js.map +2 -2
- package/dist/components/richTextEditor/MentionSuggestions.cjs +6 -7
- package/dist/components/richTextEditor/MentionSuggestions.cjs.map +2 -2
- package/dist/components/richTextEditor/MentionSuggestions.d.cts +3 -1
- package/dist/components/richTextEditor/MentionSuggestions.d.cts.map +1 -1
- package/dist/components/richTextEditor/MentionSuggestions.d.mts +3 -1
- package/dist/components/richTextEditor/MentionSuggestions.d.mts.map +1 -1
- package/dist/components/richTextEditor/MentionSuggestions.d.ts +3 -1
- package/dist/components/richTextEditor/MentionSuggestions.d.ts.map +1 -1
- package/dist/components/richTextEditor/MentionSuggestions.js +6 -7
- package/dist/components/richTextEditor/MentionSuggestions.js.map +2 -2
- package/dist/components/richTextEditor/RichTextEditor.cjs +17 -10
- package/dist/components/richTextEditor/RichTextEditor.cjs.map +3 -3
- package/dist/components/richTextEditor/RichTextEditor.d.cts +2 -1
- package/dist/components/richTextEditor/RichTextEditor.d.cts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.d.mts +2 -1
- package/dist/components/richTextEditor/RichTextEditor.d.mts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.d.ts +2 -1
- package/dist/components/richTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.js +17 -10
- package/dist/components/richTextEditor/RichTextEditor.js.map +3 -3
- package/dist/components/segmented-control.css +14 -5
- package/dist/docs/component-index.json +1 -1
- package/dist/docs/components/alert.md +4 -0
- package/dist/docs/components/box.md +3 -1
- package/dist/docs/components/config-drawer.md +3 -1
- package/dist/docs/components/grid.md +2 -0
- package/dist/docs/components/input-otp.md +10 -2
- package/dist/docs/components/layout-props.md +4 -1
- package/dist/docs/components/link.md +4 -0
- package/dist/docs/components/rich-text-editor.md +6 -1
- package/dist/docs/components/segmented-control.md +3 -2
- package/dist/layout/Layout.cjs +13 -9
- package/dist/layout/Layout.cjs.map +2 -2
- package/dist/layout/Layout.d.cts.map +1 -1
- package/dist/layout/Layout.d.mts.map +1 -1
- package/dist/layout/Layout.d.ts.map +1 -1
- package/dist/layout/Layout.js +13 -9
- package/dist/layout/Layout.js.map +2 -2
- package/dist/layout/grid-area.cjs +32 -0
- package/dist/layout/grid-area.cjs.map +7 -0
- package/dist/layout/grid-area.d.cts +12 -0
- package/dist/layout/grid-area.d.cts.map +1 -0
- package/dist/layout/grid-area.d.mts +12 -0
- package/dist/layout/grid-area.d.mts.map +1 -0
- package/dist/layout/grid-area.d.ts +12 -0
- package/dist/layout/grid-area.d.ts.map +1 -0
- package/dist/layout/grid-area.js +12 -0
- package/dist/layout/grid-area.js.map +7 -0
- package/dist/styles.css +11366 -12134
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inputOtp/InputOtp.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { Slot } from '@radix-ui/react-slot'\nimport { OTPInput, OTPInputContext, type OTPInputProps as BaseOTPInputProps, type RenderProps } from 'input-otp'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n} from './inputOtp.props'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype InputOTPOwnProps = GetPropDefTypes<typeof inputOTPPropDefs>\ntype InputOTPGroupOwnProps = GetPropDefTypes<typeof inputOTPGroupPropDefs>\n\ntype InputOTPProps = Omit<BaseOTPInputProps, 'children' | 'maxLength' | 'render'> &\n InputOTPOwnProps & {\n children: React.ReactNode\n maxLength?: number\n }\n\ninterface InputOTPGroupProps extends React.ComponentPropsWithoutRef<'div'>, InputOTPGroupOwnProps {}\n\ntype InputOTPSlotProps = React.ComponentPropsWithoutRef<'div'> & { index: number }\ntype InputOTPSeparatorProps = React.ComponentPropsWithoutRef<'div'>\n\nconst InputOtp = React.forwardRef<React.ComponentRef<typeof OTPInput>, InputOTPProps>((props, forwardedRef) => {\n const { asChild, children, className: propClassName, containerClassName, maxLength = 6, ...inputProps } = props\n const { asChild: extractedAsChild, className, size = 'md', radius = 'md', ...resolvedInputProps } = extractProps(\n {\n ...inputProps,\n asChild,\n className: propClassName,\n },\n inputOTPPropDefs,\n )\n void extractedAsChild\n\n return (\n <OTPInput\n {...resolvedInputProps}\n ref={forwardedRef}\n maxLength={maxLength}\n containerClassName={classNames('dsx-input-otp', containerClassName)}\n className={classNames('dsx-input-otp__hidden-input', className)}\n data-size={size}\n data-radius={radius}\n data-slot=\"input-otp-input\"\n >\n {children}\n </OTPInput>\n )\n})\nInputOtp.displayName = 'InputOtp'\n\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>((props, forwardedRef) => {\n const { asChild, className, ...groupProps } = extractProps(props, inputOTPGroupPropDefs)\n const Comp = asChild ? Slot : 'div'\n\n return <Comp {...groupProps} ref={forwardedRef} className={classNames('dsx-input-otp__group', className)} data-slot=\"input-otp-group\" />\n})\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>((props, forwardedRef) => {\n const { className, index, ...slotProps } = extractProps(props, inputOTPSlotPropDefs)\n const inputOTPContext = React.useContext(OTPInputContext) as RenderProps\n const slot = inputOTPContext.slots[index]\n\n if (!slot) {\n return <div {...slotProps} ref={forwardedRef} className={classNames('dsx-input-otp__slot', className)} data-slot=\"input-otp-slot\" />\n }\n\n const { char, hasFakeCaret, isActive } = slot\n\n return (\n <div\n {...slotProps}\n ref={forwardedRef}\n className={classNames('dsx-input-otp__slot', className)}\n data-active={isActive ? 'true' : undefined}\n data-filled={char ? 'true' : undefined}\n data-slot=\"input-otp-slot\"\n >\n {char}\n {hasFakeCaret ? (\n <div className=\"dsx-input-otp__caret-wrapper\" data-slot=\"input-otp-caret-wrapper\">\n <div className=\"dsx-input-otp__caret\" data-slot=\"input-otp-caret\" />\n </div>\n ) : null}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<HTMLDivElement, InputOTPSeparatorProps>((props, forwardedRef) => {\n const { className, ...separatorProps } = extractProps(props, inputOTPSeparatorPropDefs)\n\n return (\n <div\n {...separatorProps}\n ref={forwardedRef}\n role=\"separator\"\n className={classNames('dsx-input-otp__separator', className)}\n data-slot=\"input-otp-separator\"\n >\n <div className=\"dsx-input-otp__separator-dash\" data-slot=\"input-otp-separator-dash\" />\n </div>\n )\n})\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nconst OTPField = Object.assign(InputOtp, {\n Group: InputOTPGroup,\n Slot: InputOTPSlot,\n Separator: InputOTPSeparator,\n})\n\nexport { InputOtp, InputOTPGroup, InputOTPSeparator, InputOTPSlot, OTPField }\nexport type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps }\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,wBAAuB;AACvB,wBAAqB;AACrB,uBAAqG;AAErG,0BAA6B;AAC7B,sBAKO;AA+BH;AAbJ,MAAM,WAAW,MAAM,WAA+D,CAAC,OAAO,iBAAiB;AAC7G,QAAM,EAAE,SAAS,UAAU,WAAW,eAAe,oBAAoB,YAAY,GAAG,GAAG,WAAW,IAAI;AAC1G,QAAM,EAAE,SAAS,kBAAkB,WAAW,OAAO,MAAM,SAAS,MAAM,GAAG,mBAAmB,QAAI;AAAA,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { Slot } from '@radix-ui/react-slot'\nimport { OTPInput, OTPInputContext, type OTPInputProps as BaseOTPInputProps, type RenderProps } from 'input-otp'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n} from './inputOtp.props'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype InputOTPOwnProps = GetPropDefTypes<typeof inputOTPPropDefs>\ntype InputOTPGroupOwnProps = GetPropDefTypes<typeof inputOTPGroupPropDefs>\n\ntype InputOTPProps = Omit<BaseOTPInputProps, 'children' | 'maxLength' | 'render'> &\n InputOTPOwnProps & {\n children: React.ReactNode\n maxLength?: number\n }\n\ninterface InputOTPGroupProps extends React.ComponentPropsWithoutRef<'div'>, InputOTPGroupOwnProps {}\n\ntype InputOTPSlotProps = React.ComponentPropsWithoutRef<'div'> & { index: number }\ntype InputOTPSeparatorProps = React.ComponentPropsWithoutRef<'div'>\n\nconst InputOtp = React.forwardRef<React.ComponentRef<typeof OTPInput>, InputOTPProps>((props, forwardedRef) => {\n const { asChild, children, className: propClassName, containerClassName, maxLength = 6, ...inputProps } = props\n const { asChild: extractedAsChild, className, size = 'md', radius = 'md', fill = false, ...resolvedInputProps } = extractProps(\n {\n ...inputProps,\n asChild,\n className: propClassName,\n },\n inputOTPPropDefs,\n )\n void extractedAsChild\n\n return (\n <OTPInput\n {...resolvedInputProps}\n ref={forwardedRef}\n maxLength={maxLength}\n containerClassName={classNames('dsx-input-otp', containerClassName)}\n className={classNames('dsx-input-otp__hidden-input', className)}\n data-size={size}\n data-radius={radius}\n data-fill={fill || undefined}\n data-slot=\"input-otp-input\"\n >\n {children}\n </OTPInput>\n )\n})\nInputOtp.displayName = 'InputOtp'\n\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>((props, forwardedRef) => {\n const { asChild, className, ...groupProps } = extractProps(props, inputOTPGroupPropDefs)\n const Comp = asChild ? Slot : 'div'\n\n return <Comp {...groupProps} ref={forwardedRef} className={classNames('dsx-input-otp__group', className)} data-slot=\"input-otp-group\" />\n})\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>((props, forwardedRef) => {\n const { className, index, ...slotProps } = extractProps(props, inputOTPSlotPropDefs)\n const inputOTPContext = React.useContext(OTPInputContext) as RenderProps\n const slot = inputOTPContext.slots[index]\n\n if (!slot) {\n return <div {...slotProps} ref={forwardedRef} className={classNames('dsx-input-otp__slot', className)} data-slot=\"input-otp-slot\" />\n }\n\n const { char, hasFakeCaret, isActive } = slot\n\n return (\n <div\n {...slotProps}\n ref={forwardedRef}\n className={classNames('dsx-input-otp__slot', className)}\n data-active={isActive ? 'true' : undefined}\n data-filled={char ? 'true' : undefined}\n data-slot=\"input-otp-slot\"\n >\n {char}\n {hasFakeCaret ? (\n <div className=\"dsx-input-otp__caret-wrapper\" data-slot=\"input-otp-caret-wrapper\">\n <div className=\"dsx-input-otp__caret\" data-slot=\"input-otp-caret\" />\n </div>\n ) : null}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<HTMLDivElement, InputOTPSeparatorProps>((props, forwardedRef) => {\n const { className, ...separatorProps } = extractProps(props, inputOTPSeparatorPropDefs)\n\n return (\n <div\n {...separatorProps}\n ref={forwardedRef}\n role=\"separator\"\n className={classNames('dsx-input-otp__separator', className)}\n data-slot=\"input-otp-separator\"\n >\n <div className=\"dsx-input-otp__separator-dash\" data-slot=\"input-otp-separator-dash\" />\n </div>\n )\n})\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nconst OTPField = Object.assign(InputOtp, {\n Group: InputOTPGroup,\n Slot: InputOTPSlot,\n Separator: InputOTPSeparator,\n})\n\nexport { InputOtp, InputOTPGroup, InputOTPSeparator, InputOTPSlot, OTPField }\nexport type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,wBAAuB;AACvB,wBAAqB;AACrB,uBAAqG;AAErG,0BAA6B;AAC7B,sBAKO;AA+BH;AAbJ,MAAM,WAAW,MAAM,WAA+D,CAAC,OAAO,iBAAiB;AAC7G,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M,cAAc,SAAS,IAAI;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,eAAW,kBAAAA,SAAW,uBAAuB,SAAS;AAAA,MACtD,eAAa,WAAW,SAAS;AAAA,MACjC,eAAa,OAAO,SAAS;AAAA,MAC7B,aAAU;AAAA,MAET;AAAA;AAAA,QACA,eACC,4CAAC,SAAI,WAAU,gCAA+B,aAAU,2BACtD,sDAAC,SAAI,WAAU,wBAAuB,aAAU,mBAAkB,GACpE,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,aAAa,cAAc;AAE3B,MAAM,oBAAoB,MAAM,WAAmD,CAAC,OAAO,iBAAiB;AAC1G,QAAM,EAAE,WAAW,GAAG,eAAe,QAAI,kCAAa,OAAO,yCAAyB;AAEtF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,MAAK;AAAA,MACL,eAAW,kBAAAA,SAAW,4BAA4B,SAAS;AAAA,MAC3D,aAAU;AAAA,MAEV,sDAAC,SAAI,WAAU,iCAAgC,aAAU,4BAA2B;AAAA;AAAA,EACtF;AAEJ,CAAC;AACD,kBAAkB,cAAc;AAEhC,MAAM,WAAW,OAAO,OAAO,UAAU;AAAA,EACvC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AACb,CAAC;",
|
|
6
6
|
"names": ["classNames"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,10 @@ declare const InputOtp: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
25
25
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
26
26
|
default: "md";
|
|
27
27
|
};
|
|
28
|
+
fill: {
|
|
29
|
+
type: "boolean";
|
|
30
|
+
default: false;
|
|
31
|
+
};
|
|
28
32
|
asChild: {
|
|
29
33
|
type: "boolean";
|
|
30
34
|
default: false;
|
|
@@ -49,6 +53,10 @@ declare const OTPField: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
49
53
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
50
54
|
default: "md";
|
|
51
55
|
};
|
|
56
|
+
fill: {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
default: false;
|
|
59
|
+
};
|
|
52
60
|
asChild: {
|
|
53
61
|
type: "boolean";
|
|
54
62
|
default: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOtp.d.cts","sourceRoot":"","sources":["../../../src/components/inputOtp/InputOtp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAA6B,KAAK,aAAa,IAAI,iBAAiB,EAAoB,MAAM,WAAW,CAAA;AAGhH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAGjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAChE,KAAK,qBAAqB,GAAG,eAAe,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE1E,KAAK,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC,GAC/E,gBAAgB,GAAG;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAEH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,qBAAqB;CAAG;AAEpG,KAAK,iBAAiB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAClF,KAAK,sBAAsB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEnE,QAAA,MAAM,QAAQ
|
|
1
|
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SAAS;gBACb,MAAM;;;;eAKoD,MAAM;;;CA6F9E,CAAA;AAEF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AAC7E,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -25,6 +25,10 @@ declare const InputOtp: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
25
25
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
26
26
|
default: "md";
|
|
27
27
|
};
|
|
28
|
+
fill: {
|
|
29
|
+
type: "boolean";
|
|
30
|
+
default: false;
|
|
31
|
+
};
|
|
28
32
|
asChild: {
|
|
29
33
|
type: "boolean";
|
|
30
34
|
default: false;
|
|
@@ -49,6 +53,10 @@ declare const OTPField: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
49
53
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
50
54
|
default: "md";
|
|
51
55
|
};
|
|
56
|
+
fill: {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
default: false;
|
|
59
|
+
};
|
|
52
60
|
asChild: {
|
|
53
61
|
type: "boolean";
|
|
54
62
|
default: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOtp.d.mts","sourceRoot":"","sources":["../../../src/components/inputOtp/InputOtp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAA6B,KAAK,aAAa,IAAI,iBAAiB,EAAoB,MAAM,WAAW,CAAA;AAGhH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAGjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAChE,KAAK,qBAAqB,GA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SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,qBAAqB;CAAG;AAEpG,KAAK,iBAAiB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAClF,KAAK,sBAAsB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEnE,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;cATA,KAAK,CAAC,SAAS;gBACb,MAAM;0CAmCpB,CAAA;AAGF,QAAA,MAAM,aAAa,2FAKjB,CAAA;AAGF,QAAA,MAAM,YAAY;WAzCwD,MAAM;wCAqE9E,CAAA;AAGF,QAAA,MAAM,iBAAiB,mKAcrB,CAAA;AAGF,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;cA/FA,KAAK,CAAC,SAAS;gBACb,MAAM;;;;eAKoD,MAAM;;;CA6F9E,CAAA;AAEF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AAC7E,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -25,6 +25,10 @@ declare const InputOtp: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
25
25
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
26
26
|
default: "md";
|
|
27
27
|
};
|
|
28
|
+
fill: {
|
|
29
|
+
type: "boolean";
|
|
30
|
+
default: false;
|
|
31
|
+
};
|
|
28
32
|
asChild: {
|
|
29
33
|
type: "boolean";
|
|
30
34
|
default: false;
|
|
@@ -49,6 +53,10 @@ declare const OTPField: React.ForwardRefExoticComponent<Omit<BaseOTPInputProps,
|
|
|
49
53
|
values: readonly ["none", "sm", "md", "lg", "full"];
|
|
50
54
|
default: "md";
|
|
51
55
|
};
|
|
56
|
+
fill: {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
default: false;
|
|
59
|
+
};
|
|
52
60
|
asChild: {
|
|
53
61
|
type: "boolean";
|
|
54
62
|
default: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOtp.d.ts","sourceRoot":"","sources":["../../../src/components/inputOtp/InputOtp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAA6B,KAAK,aAAa,IAAI,iBAAiB,EAAoB,MAAM,WAAW,CAAA;AAGhH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAGjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAChE,KAAK,qBAAqB,GAAG,eAAe,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE1E,KAAK,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC,GAC/E,gBAAgB,GAAG;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAEH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,qBAAqB;CAAG;AAEpG,KAAK,iBAAiB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAClF,KAAK,sBAAsB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEnE,QAAA,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"InputOtp.d.ts","sourceRoot":"","sources":["../../../src/components/inputOtp/InputOtp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;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,EAAE,CAAA;AAC7E,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
const InputOtp = React.forwardRef((props, forwardedRef) => {
|
|
15
15
|
const { asChild, children, className: propClassName, containerClassName, maxLength = 6, ...inputProps } = props;
|
|
16
|
-
const { asChild: extractedAsChild, className, size = "md", radius = "md", ...resolvedInputProps } = extractProps(
|
|
16
|
+
const { asChild: extractedAsChild, className, size = "md", radius = "md", fill = false, ...resolvedInputProps } = extractProps(
|
|
17
17
|
{
|
|
18
18
|
...inputProps,
|
|
19
19
|
asChild,
|
|
@@ -32,6 +32,7 @@ const InputOtp = React.forwardRef((props, forwardedRef) => {
|
|
|
32
32
|
className: classNames("dsx-input-otp__hidden-input", className),
|
|
33
33
|
"data-size": size,
|
|
34
34
|
"data-radius": radius,
|
|
35
|
+
"data-fill": fill || void 0,
|
|
35
36
|
"data-slot": "input-otp-input",
|
|
36
37
|
children
|
|
37
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inputOtp/InputOtp.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { Slot } from '@radix-ui/react-slot'\nimport { OTPInput, OTPInputContext, type OTPInputProps as BaseOTPInputProps, type RenderProps } from 'input-otp'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n} from './inputOtp.props'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype InputOTPOwnProps = GetPropDefTypes<typeof inputOTPPropDefs>\ntype InputOTPGroupOwnProps = GetPropDefTypes<typeof inputOTPGroupPropDefs>\n\ntype InputOTPProps = Omit<BaseOTPInputProps, 'children' | 'maxLength' | 'render'> &\n InputOTPOwnProps & {\n children: React.ReactNode\n maxLength?: number\n }\n\ninterface InputOTPGroupProps extends React.ComponentPropsWithoutRef<'div'>, InputOTPGroupOwnProps {}\n\ntype InputOTPSlotProps = React.ComponentPropsWithoutRef<'div'> & { index: number }\ntype InputOTPSeparatorProps = React.ComponentPropsWithoutRef<'div'>\n\nconst InputOtp = React.forwardRef<React.ComponentRef<typeof OTPInput>, InputOTPProps>((props, forwardedRef) => {\n const { asChild, children, className: propClassName, containerClassName, maxLength = 6, ...inputProps } = props\n const { asChild: extractedAsChild, className, size = 'md', radius = 'md', ...resolvedInputProps } = extractProps(\n {\n ...inputProps,\n asChild,\n className: propClassName,\n },\n inputOTPPropDefs,\n )\n void extractedAsChild\n\n return (\n <OTPInput\n {...resolvedInputProps}\n ref={forwardedRef}\n maxLength={maxLength}\n containerClassName={classNames('dsx-input-otp', containerClassName)}\n className={classNames('dsx-input-otp__hidden-input', className)}\n data-size={size}\n data-radius={radius}\n data-slot=\"input-otp-input\"\n >\n {children}\n </OTPInput>\n )\n})\nInputOtp.displayName = 'InputOtp'\n\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>((props, forwardedRef) => {\n const { asChild, className, ...groupProps } = extractProps(props, inputOTPGroupPropDefs)\n const Comp = asChild ? Slot : 'div'\n\n return <Comp {...groupProps} ref={forwardedRef} className={classNames('dsx-input-otp__group', className)} data-slot=\"input-otp-group\" />\n})\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>((props, forwardedRef) => {\n const { className, index, ...slotProps } = extractProps(props, inputOTPSlotPropDefs)\n const inputOTPContext = React.useContext(OTPInputContext) as RenderProps\n const slot = inputOTPContext.slots[index]\n\n if (!slot) {\n return <div {...slotProps} ref={forwardedRef} className={classNames('dsx-input-otp__slot', className)} data-slot=\"input-otp-slot\" />\n }\n\n const { char, hasFakeCaret, isActive } = slot\n\n return (\n <div\n {...slotProps}\n ref={forwardedRef}\n className={classNames('dsx-input-otp__slot', className)}\n data-active={isActive ? 'true' : undefined}\n data-filled={char ? 'true' : undefined}\n data-slot=\"input-otp-slot\"\n >\n {char}\n {hasFakeCaret ? (\n <div className=\"dsx-input-otp__caret-wrapper\" data-slot=\"input-otp-caret-wrapper\">\n <div className=\"dsx-input-otp__caret\" data-slot=\"input-otp-caret\" />\n </div>\n ) : null}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<HTMLDivElement, InputOTPSeparatorProps>((props, forwardedRef) => {\n const { className, ...separatorProps } = extractProps(props, inputOTPSeparatorPropDefs)\n\n return (\n <div\n {...separatorProps}\n ref={forwardedRef}\n role=\"separator\"\n className={classNames('dsx-input-otp__separator', className)}\n data-slot=\"input-otp-separator\"\n >\n <div className=\"dsx-input-otp__separator-dash\" data-slot=\"input-otp-separator-dash\" />\n </div>\n )\n})\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nconst OTPField = Object.assign(InputOtp, {\n Group: InputOTPGroup,\n Slot: InputOTPSlot,\n Separator: InputOTPSeparator,\n})\n\nexport { InputOtp, InputOTPGroup, InputOTPSeparator, InputOTPSlot, OTPField }\nexport type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps }\n"],
|
|
5
|
-
"mappings": ";AAEA,YAAY,WAAW;AACvB,OAAO,gBAAgB;AACvB,SAAS,YAAY;AACrB,SAAS,UAAU,uBAAkF;AAErG,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA+BH,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { Slot } from '@radix-ui/react-slot'\nimport { OTPInput, OTPInputContext, type OTPInputProps as BaseOTPInputProps, type RenderProps } from 'input-otp'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n} from './inputOtp.props'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype InputOTPOwnProps = GetPropDefTypes<typeof inputOTPPropDefs>\ntype InputOTPGroupOwnProps = GetPropDefTypes<typeof inputOTPGroupPropDefs>\n\ntype InputOTPProps = Omit<BaseOTPInputProps, 'children' | 'maxLength' | 'render'> &\n InputOTPOwnProps & {\n children: React.ReactNode\n maxLength?: number\n }\n\ninterface InputOTPGroupProps extends React.ComponentPropsWithoutRef<'div'>, InputOTPGroupOwnProps {}\n\ntype InputOTPSlotProps = React.ComponentPropsWithoutRef<'div'> & { index: number }\ntype InputOTPSeparatorProps = React.ComponentPropsWithoutRef<'div'>\n\nconst InputOtp = React.forwardRef<React.ComponentRef<typeof OTPInput>, InputOTPProps>((props, forwardedRef) => {\n const { asChild, children, className: propClassName, containerClassName, maxLength = 6, ...inputProps } = props\n const { asChild: extractedAsChild, className, size = 'md', radius = 'md', fill = false, ...resolvedInputProps } = extractProps(\n {\n ...inputProps,\n asChild,\n className: propClassName,\n },\n inputOTPPropDefs,\n )\n void extractedAsChild\n\n return (\n <OTPInput\n {...resolvedInputProps}\n ref={forwardedRef}\n maxLength={maxLength}\n containerClassName={classNames('dsx-input-otp', containerClassName)}\n className={classNames('dsx-input-otp__hidden-input', className)}\n data-size={size}\n data-radius={radius}\n data-fill={fill || undefined}\n data-slot=\"input-otp-input\"\n >\n {children}\n </OTPInput>\n )\n})\nInputOtp.displayName = 'InputOtp'\n\nconst InputOTPGroup = React.forwardRef<HTMLDivElement, InputOTPGroupProps>((props, forwardedRef) => {\n const { asChild, className, ...groupProps } = extractProps(props, inputOTPGroupPropDefs)\n const Comp = asChild ? Slot : 'div'\n\n return <Comp {...groupProps} ref={forwardedRef} className={classNames('dsx-input-otp__group', className)} data-slot=\"input-otp-group\" />\n})\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>((props, forwardedRef) => {\n const { className, index, ...slotProps } = extractProps(props, inputOTPSlotPropDefs)\n const inputOTPContext = React.useContext(OTPInputContext) as RenderProps\n const slot = inputOTPContext.slots[index]\n\n if (!slot) {\n return <div {...slotProps} ref={forwardedRef} className={classNames('dsx-input-otp__slot', className)} data-slot=\"input-otp-slot\" />\n }\n\n const { char, hasFakeCaret, isActive } = slot\n\n return (\n <div\n {...slotProps}\n ref={forwardedRef}\n className={classNames('dsx-input-otp__slot', className)}\n data-active={isActive ? 'true' : undefined}\n data-filled={char ? 'true' : undefined}\n data-slot=\"input-otp-slot\"\n >\n {char}\n {hasFakeCaret ? (\n <div className=\"dsx-input-otp__caret-wrapper\" data-slot=\"input-otp-caret-wrapper\">\n <div className=\"dsx-input-otp__caret\" data-slot=\"input-otp-caret\" />\n </div>\n ) : null}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<HTMLDivElement, InputOTPSeparatorProps>((props, forwardedRef) => {\n const { className, ...separatorProps } = extractProps(props, inputOTPSeparatorPropDefs)\n\n return (\n <div\n {...separatorProps}\n ref={forwardedRef}\n role=\"separator\"\n className={classNames('dsx-input-otp__separator', className)}\n data-slot=\"input-otp-separator\"\n >\n <div className=\"dsx-input-otp__separator-dash\" data-slot=\"input-otp-separator-dash\" />\n </div>\n )\n})\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nconst OTPField = Object.assign(InputOtp, {\n Group: InputOTPGroup,\n Slot: InputOTPSlot,\n Separator: InputOTPSeparator,\n})\n\nexport { InputOtp, InputOTPGroup, InputOTPSeparator, InputOTPSlot, OTPField }\nexport type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps }\n"],
|
|
5
|
+
"mappings": ";AAEA,YAAY,WAAW;AACvB,OAAO,gBA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gBAAgB,MAAM,KAAK;AAExC,MAAI,CAAC,MAAM;AACT,WAAO,oBAAC,SAAK,GAAG,WAAW,KAAK,cAAc,WAAW,WAAW,uBAAuB,SAAS,GAAG,aAAU,kBAAiB;AAAA,EACpI;AAEA,QAAM,EAAE,MAAM,cAAc,SAAS,IAAI;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,WAAW,WAAW,uBAAuB,SAAS;AAAA,MACtD,eAAa,WAAW,SAAS;AAAA,MACjC,eAAa,OAAO,SAAS;AAAA,MAC7B,aAAU;AAAA,MAET;AAAA;AAAA,QACA,eACC,oBAAC,SAAI,WAAU,gCAA+B,aAAU,2BACtD,8BAAC,SAAI,WAAU,wBAAuB,aAAU,mBAAkB,GACpE,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,aAAa,cAAc;AAE3B,MAAM,oBAAoB,MAAM,WAAmD,CAAC,OAAO,iBAAiB;AAC1G,QAAM,EAAE,WAAW,GAAG,eAAe,IAAI,aAAa,OAAO,yBAAyB;AAEtF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,MAAK;AAAA,MACL,WAAW,WAAW,4BAA4B,SAAS;AAAA,MAC3D,aAAU;AAAA,MAEV,8BAAC,SAAI,WAAU,iCAAgC,aAAU,4BAA2B;AAAA;AAAA,EACtF;AAEJ,CAAC;AACD,kBAAkB,cAAc;AAEhC,MAAM,WAAW,OAAO,OAAO,UAAU;AAAA,EACvC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AACb,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inputOtp/inputOtp.props.ts"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../../_internal/props/asChild.prop'\n\nimport type { PropDef } from '../../_internal/props/propDef'\n\nconst inputOTPSizes = ['sm', 'md', 'lg'] as const\nconst inputOTPRadiusValues = ['none', 'sm', 'md', 'lg', 'full'] as const\n\nconst inputOTPPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n values: inputOTPSizes,\n default: 'md',\n },\n radius: {\n type: 'enum',\n values: inputOTPRadiusValues,\n default: 'md',\n },\n} satisfies {\n asChild: PropDef\n size: PropDef<(typeof inputOTPSizes)[number]>\n radius: PropDef<(typeof inputOTPRadiusValues)[number]>\n}\n\nconst inputOTPGroupPropDefs = {\n ...asChildPropDef,\n} satisfies {\n asChild: PropDef\n}\n\nconst inputOTPSlotPropDefs = {} satisfies Record<string, never>\n\nconst inputOTPSeparatorPropDefs = {} satisfies Record<string, never>\n\nexport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B;AAI/B,MAAM,gBAAgB,CAAC,MAAM,MAAM,IAAI;AACvC,MAAM,uBAAuB,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM;AAE9D,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF;
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../../_internal/props/asChild.prop'\n\nimport type { PropDef } from '../../_internal/props/propDef'\n\nconst inputOTPSizes = ['sm', 'md', 'lg'] as const\nconst inputOTPRadiusValues = ['none', 'sm', 'md', 'lg', 'full'] as const\n\nconst inputOTPPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n values: inputOTPSizes,\n default: 'md',\n },\n radius: {\n type: 'enum',\n values: inputOTPRadiusValues,\n default: 'md',\n },\n fill: {\n type: 'boolean',\n default: false,\n },\n} satisfies {\n asChild: PropDef\n size: PropDef<(typeof inputOTPSizes)[number]>\n radius: PropDef<(typeof inputOTPRadiusValues)[number]>\n fill: PropDef\n}\n\nconst inputOTPGroupPropDefs = {\n ...asChildPropDef,\n} satisfies {\n asChild: PropDef\n}\n\nconst inputOTPSlotPropDefs = {} satisfies Record<string, never>\n\nconst inputOTPSeparatorPropDefs = {} satisfies Record<string, never>\n\nexport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B;AAI/B,MAAM,gBAAgB,CAAC,MAAM,MAAM,IAAI;AACvC,MAAM,uBAAuB,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM;AAE9D,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;AAOA,MAAM,wBAAwB;AAAA,EAC5B,GAAG;AACL;AAIA,MAAM,uBAAuB,CAAC;AAE9B,MAAM,4BAA4B,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputOtp.props.d.cts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"inputOtp.props.d.cts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAqBrB,CAAA;AAED,QAAA,MAAM,qBAAqB;;;;;CAI1B,CAAA;AAED,QAAA,MAAM,oBAAoB,IAAqC,CAAA;AAE/D,QAAA,MAAM,yBAAyB,IAAqC,CAAA;AAEpE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,GACrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputOtp.props.d.mts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"inputOtp.props.d.mts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAqBrB,CAAA;AAED,QAAA,MAAM,qBAAqB;;;;;CAI1B,CAAA;AAED,QAAA,MAAM,oBAAoB,IAAqC,CAAA;AAE/D,QAAA,MAAM,yBAAyB,IAAqC,CAAA;AAEpE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,GACrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputOtp.props.d.ts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"inputOtp.props.d.ts","sourceRoot":"","sources":["../../../src/components/inputOtp/inputOtp.props.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAqBrB,CAAA;AAED,QAAA,MAAM,qBAAqB;;;;;CAI1B,CAAA;AAED,QAAA,MAAM,oBAAoB,IAAqC,CAAA;AAE/D,QAAA,MAAM,yBAAyB,IAAqC,CAAA;AAEpE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,GACrB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inputOtp/inputOtp.props.ts"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../../_internal/props/asChild.prop'\n\nimport type { PropDef } from '../../_internal/props/propDef'\n\nconst inputOTPSizes = ['sm', 'md', 'lg'] as const\nconst inputOTPRadiusValues = ['none', 'sm', 'md', 'lg', 'full'] as const\n\nconst inputOTPPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n values: inputOTPSizes,\n default: 'md',\n },\n radius: {\n type: 'enum',\n values: inputOTPRadiusValues,\n default: 'md',\n },\n} satisfies {\n asChild: PropDef\n size: PropDef<(typeof inputOTPSizes)[number]>\n radius: PropDef<(typeof inputOTPRadiusValues)[number]>\n}\n\nconst inputOTPGroupPropDefs = {\n ...asChildPropDef,\n} satisfies {\n asChild: PropDef\n}\n\nconst inputOTPSlotPropDefs = {} satisfies Record<string, never>\n\nconst inputOTPSeparatorPropDefs = {} satisfies Record<string, never>\n\nexport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,sBAAsB;AAI/B,MAAM,gBAAgB,CAAC,MAAM,MAAM,IAAI;AACvC,MAAM,uBAAuB,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM;AAE9D,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF;
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../../_internal/props/asChild.prop'\n\nimport type { PropDef } from '../../_internal/props/propDef'\n\nconst inputOTPSizes = ['sm', 'md', 'lg'] as const\nconst inputOTPRadiusValues = ['none', 'sm', 'md', 'lg', 'full'] as const\n\nconst inputOTPPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n values: inputOTPSizes,\n default: 'md',\n },\n radius: {\n type: 'enum',\n values: inputOTPRadiusValues,\n default: 'md',\n },\n fill: {\n type: 'boolean',\n default: false,\n },\n} satisfies {\n asChild: PropDef\n size: PropDef<(typeof inputOTPSizes)[number]>\n radius: PropDef<(typeof inputOTPRadiusValues)[number]>\n fill: PropDef\n}\n\nconst inputOTPGroupPropDefs = {\n ...asChildPropDef,\n} satisfies {\n asChild: PropDef\n}\n\nconst inputOTPSlotPropDefs = {} satisfies Record<string, never>\n\nconst inputOTPSeparatorPropDefs = {} satisfies Record<string, never>\n\nexport {\n inputOTPGroupPropDefs,\n inputOTPPropDefs,\n inputOTPSeparatorPropDefs,\n inputOTPSlotPropDefs,\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;AAI/B,MAAM,gBAAgB,CAAC,MAAM,MAAM,IAAI;AACvC,MAAM,uBAAuB,CAAC,QAAQ,MAAM,MAAM,MAAM,MAAM;AAE9D,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;AAOA,MAAM,wBAAwB;AAAA,EAC5B,GAAG;AACL;AAIA,MAAM,uBAAuB,CAAC;AAE9B,MAAM,4BAA4B,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/components/link.css
CHANGED
|
@@ -78,6 +78,27 @@
|
|
|
78
78
|
color: var(--dsx-color-high-contrast);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/* A `<button>` host (`asChild`) is a link-weight action, "Resend (0:42)" inside a sentence. The browser's button chrome (grey fill, 2px
|
|
82
|
+
outset border, 6px padding, its own font) is reset so it reads in the line like an anchor; the reset adds no specificity beyond the
|
|
83
|
+
class, so a size or a tone still wins over it. A disabled one drops to the muted ink and stops looking clickable. Both come after
|
|
84
|
+
the colour rules above so they win over them. */
|
|
85
|
+
.dsx-link:where(button) {
|
|
86
|
+
appearance: none;
|
|
87
|
+
margin: 0;
|
|
88
|
+
padding: 0;
|
|
89
|
+
border: 0;
|
|
90
|
+
background: none;
|
|
91
|
+
font: inherit;
|
|
92
|
+
letter-spacing: inherit;
|
|
93
|
+
text-align: inherit;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dsx-link:where(button):disabled {
|
|
97
|
+
color: var(--dsx-color-on-surface-variant);
|
|
98
|
+
cursor: not-allowed;
|
|
99
|
+
text-decoration-line: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
81
102
|
@media (prefers-reduced-motion: reduce) {
|
|
82
103
|
.dsx-link {
|
|
83
104
|
transition: none;
|
|
@@ -281,7 +281,9 @@
|
|
|
281
281
|
.dsx-editor-tools__choices { display: grid; gap: var(--dsx-space-xs); max-height: var(--radix-popover-content-available-height); overflow-y: auto; min-width: 0; }
|
|
282
282
|
.dsx-editor-tools__choices .dsx-button { justify-content: flex-start; text-align: start; white-space: normal; }
|
|
283
283
|
.dsx-editor-tools__choices small { display: block; color: var(--dsx-color-on-surface-variant); overflow-wrap: anywhere; }
|
|
284
|
+
.dsx-editor-tools__choices .dsx-button:where([data-variant='secondary']) small { color: inherit; }
|
|
284
285
|
.dsx-editor-token { display: inline; padding: var(--dsx-space-0-5) var(--dsx-space-xs); border: var(--dsx-border-width-sm) solid var(--dsx-color-accent-border); border-radius: var(--dsx-rounded-sm); background: var(--dsx-color-primary-container); color: var(--dsx-color-on-primary-container); white-space: normal; }
|
|
285
286
|
.dsx-editor-token--unknown { border-style: dashed; border-color: var(--dsx-color-error); color: var(--dsx-color-error); background: var(--dsx-color-surface); }
|
|
287
|
+
.dsx-rich-text-editor__prosemirror ::selection { background: var(--dsx-color-accent-surface); color: var(--dsx-color-on-surface); }
|
|
286
288
|
.dsx-rich-text-editor__prosemirror h4 { font-size: var(--dsx-typography-label-large-font-size); line-height: var(--dsx-typography-label-large-line-height); }
|
|
287
289
|
.dsx-editor-tools__suggestions { display: flex; flex-wrap: wrap; width: 100%; align-items: center; gap: var(--dsx-space-sm); padding: var(--dsx-space-sm); border: var(--dsx-border-width-sm) solid var(--dsx-color-outline); border-radius: var(--dsx-rounded-md); background: var(--dsx-color-surface-raised); }
|
|
@@ -28,7 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var EditorTools_exports = {};
|
|
30
30
|
__export(EditorTools_exports, {
|
|
31
|
-
EditorTools: () => EditorTools
|
|
31
|
+
EditorTools: () => EditorTools,
|
|
32
|
+
defaultRichTextEditorLocaleText: () => defaultRichTextEditorLocaleText,
|
|
33
|
+
resolveRichTextEditorLocaleText: () => resolveRichTextEditorLocaleText
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(EditorTools_exports);
|
|
34
36
|
var React = __toESM(require("react"), 1);
|
|
@@ -42,11 +44,62 @@ var import_TextField = require("../textField/TextField");
|
|
|
42
44
|
var import_VisuallyHidden = require("../visuallyHidden/VisuallyHidden");
|
|
43
45
|
var import_MentionSuggestions = require("./MentionSuggestions");
|
|
44
46
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
const defaultRichTextEditorLocaleText = {
|
|
48
|
+
loading: "Editor loading",
|
|
49
|
+
empty: "Ready to write",
|
|
50
|
+
characterCount: (count) => `${count} characters`,
|
|
51
|
+
toolbarLabel: "Formatting toolbar",
|
|
52
|
+
blockStyleGroup: "Block style",
|
|
53
|
+
textStyleGroup: "Text style",
|
|
54
|
+
insertGroup: "Insert",
|
|
55
|
+
historyGroup: "History",
|
|
56
|
+
textStyle: "Text style",
|
|
57
|
+
paragraph: "Paragraph",
|
|
58
|
+
heading: (level) => `Heading ${level}`,
|
|
59
|
+
quoteBlock: "Quote block",
|
|
60
|
+
codeBlock: "Code block",
|
|
61
|
+
insert: "Insert",
|
|
62
|
+
bold: "Bold",
|
|
63
|
+
italic: "Italic",
|
|
64
|
+
strikethrough: "Strikethrough",
|
|
65
|
+
inlineCode: "Inline code",
|
|
66
|
+
bulletList: "Bulleted list",
|
|
67
|
+
orderedList: "Numbered list",
|
|
68
|
+
link: "Link",
|
|
69
|
+
clearFormatting: "Clear formatting",
|
|
70
|
+
undo: "Undo",
|
|
71
|
+
redo: "Redo",
|
|
72
|
+
variable: "Variable",
|
|
73
|
+
mention: "Mention",
|
|
74
|
+
insertVariable: "Insert variable",
|
|
75
|
+
mentionSomeone: "Mention someone",
|
|
76
|
+
variableDescription: "Insert a key. Its value is resolved by your application.",
|
|
77
|
+
mentionDescription: "Select a person to insert their stable identity.",
|
|
78
|
+
searchVariables: "Search variables",
|
|
79
|
+
searchPeople: "Search people",
|
|
80
|
+
variables: "Variables",
|
|
81
|
+
people: "People",
|
|
82
|
+
noMatches: "No matches",
|
|
83
|
+
sensitiveSuffix: " \xB7 Sensitive",
|
|
84
|
+
editLink: "Edit link",
|
|
85
|
+
linkDescription: "Link the selected text or insert a URL at the caret.",
|
|
86
|
+
urlLabel: "URL",
|
|
87
|
+
urlInvalid: "Enter a valid https, http, mailto or tel URL.",
|
|
88
|
+
saveLink: "Save link",
|
|
89
|
+
removeLink: "Remove link",
|
|
90
|
+
mentionSuggestions: "Mention suggestions",
|
|
91
|
+
peopleMatching: (query) => `People matching @${query}`,
|
|
92
|
+
noMatchingPeople: "No matching people"
|
|
93
|
+
};
|
|
94
|
+
function resolveRichTextEditorLocaleText(localeText) {
|
|
95
|
+
return { ...defaultRichTextEditorLocaleText, ...localeText };
|
|
96
|
+
}
|
|
45
97
|
const defaults = ["style", "bold", "italic", "strike", "code", "bulletList", "orderedList", "blockquote", "codeBlock", "link", "clear", "history"];
|
|
46
98
|
function Control({ children, ...props }) {
|
|
47
99
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Toolbar.Toolbar.Button, { asChild: true, disabled: props.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", size: "sm", variant: "ghost", className: "dsx-rich-text-editor__toolbar-button", ...props, children }) });
|
|
48
100
|
}
|
|
49
|
-
function TokenPicker({ editor, disabled, records, kind }) {
|
|
101
|
+
function TokenPicker({ editor, disabled, records, kind, localeText }) {
|
|
102
|
+
const locale = resolveRichTextEditorLocaleText(localeText);
|
|
50
103
|
const [open, setOpen] = React.useState(false);
|
|
51
104
|
const [query, setQuery] = React.useState("");
|
|
52
105
|
const [active, setActive] = React.useState(0);
|
|
@@ -63,14 +116,14 @@ function TokenPicker({ editor, disabled, records, kind }) {
|
|
|
63
116
|
setQuery("");
|
|
64
117
|
setActive(0);
|
|
65
118
|
}, children: [
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled, children: kind === "variable" ?
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled, children: kind === "variable" ? locale.variable : locale.mention }) }),
|
|
67
120
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Popover.Popover.Content, { className: "dsx-editor-tools__popover", align: "start", onCloseAutoFocus: (event) => {
|
|
68
121
|
event.preventDefault();
|
|
69
122
|
editor.commands.focus();
|
|
70
123
|
}, children: [
|
|
71
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Title, { children: kind === "variable" ?
|
|
72
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Description, { children: kind === "variable" ?
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField.Input, { "aria-label": kind === "variable" ?
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Title, { children: kind === "variable" ? locale.insertVariable : locale.mentionSomeone }),
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Description, { children: kind === "variable" ? locale.variableDescription : locale.mentionDescription }),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField.Input, { "aria-label": kind === "variable" ? locale.searchVariables : locale.searchPeople, role: "combobox", "aria-expanded": "true", "aria-controls": listId, "aria-activedescendant": matches.length ? `${listId}-${active}` : void 0, value: query, onChange: (event) => {
|
|
74
127
|
setQuery(event.target.value);
|
|
75
128
|
setActive(0);
|
|
76
129
|
}, onKeyDown: (event) => {
|
|
@@ -83,18 +136,19 @@ function TokenPicker({ editor, disabled, records, kind }) {
|
|
|
83
136
|
insert(active);
|
|
84
137
|
}
|
|
85
138
|
} }) }),
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id: listId, role: "listbox", "aria-label": kind === "variable" ?
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id: listId, role: "listbox", "aria-label": kind === "variable" ? locale.variables : locale.people, className: "dsx-editor-tools__choices", children: [
|
|
87
140
|
matches.map((record, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { id: `${listId}-${index}`, role: "option", "aria-selected": active === index, type: "button", variant: active === index ? "secondary" : "ghost", size: "lg", onClick: () => insert(index), onPointerMove: () => setActive(index), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
88
141
|
record.label,
|
|
89
|
-
"sensitive" in record && record.sensitive ?
|
|
142
|
+
"sensitive" in record && record.sensitive ? locale.sensitiveSuffix : "",
|
|
90
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "key" in record ? record.key : record.id })
|
|
91
144
|
] }) }, "key" in record ? record.key : record.id)),
|
|
92
|
-
!matches.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "status", children:
|
|
145
|
+
!matches.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "status", children: locale.noMatches }) : null
|
|
93
146
|
] })
|
|
94
147
|
] })
|
|
95
148
|
] });
|
|
96
149
|
}
|
|
97
|
-
function LinkControl({ editor, disabled }) {
|
|
150
|
+
function LinkControl({ editor, disabled, localeText }) {
|
|
151
|
+
const locale = resolveRichTextEditorLocaleText(localeText);
|
|
98
152
|
const [open, setOpen] = React.useState(false);
|
|
99
153
|
const [url, setUrl] = React.useState("");
|
|
100
154
|
const [error, setError] = React.useState("");
|
|
@@ -107,7 +161,7 @@ function LinkControl({ editor, disabled }) {
|
|
|
107
161
|
if (!["https:", "http:", "mailto:", "tel:"].includes(parsed.protocol)) throw new Error();
|
|
108
162
|
href = parsed.href;
|
|
109
163
|
} catch {
|
|
110
|
-
setError(
|
|
164
|
+
setError(locale.urlInvalid);
|
|
111
165
|
return;
|
|
112
166
|
}
|
|
113
167
|
const chain = editor.chain().focus().setTextSelection(selection.current);
|
|
@@ -124,14 +178,14 @@ function LinkControl({ editor, disabled }) {
|
|
|
124
178
|
;
|
|
125
179
|
setOpen(next);
|
|
126
180
|
}, children: [
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled, "aria-label":
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled, "aria-label": locale.link, "aria-pressed": editor.isActive("link"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "link", size: "sm" }) }) }),
|
|
128
182
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Popover.Popover.Content, { className: "dsx-editor-tools__popover dsx-editor-tools__link", align: "start", onCloseAutoFocus: (event) => {
|
|
129
183
|
event.preventDefault();
|
|
130
184
|
editor.commands.focus();
|
|
131
185
|
}, children: [
|
|
132
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Title, { children:
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VisuallyHidden.VisuallyHidden, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Description, { children:
|
|
134
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField, { id: urlId, label:
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Title, { children: locale.editLink }),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VisuallyHidden.VisuallyHidden, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Description, { children: locale.linkDescription }) }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField, { id: urlId, label: locale.urlLabel, errorText: error || void 0, invalid: Boolean(error), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TextField.TextField.Input, { value: url, onChange: (event) => {
|
|
135
189
|
setUrl(event.target.value);
|
|
136
190
|
setError("");
|
|
137
191
|
}, onKeyDown: (event) => {
|
|
@@ -141,16 +195,17 @@ function LinkControl({ editor, disabled }) {
|
|
|
141
195
|
}
|
|
142
196
|
} }) }),
|
|
143
197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-editor-tools__actions", children: [
|
|
144
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", size: "md", onClick: save, children:
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", size: "md", onClick: save, children: locale.saveLink }),
|
|
145
199
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", size: "md", variant: "outline", disabled: !editor.isActive("link"), onClick: () => {
|
|
146
200
|
editor.chain().focus().setTextSelection(selection.current).extendMarkRange("link").unsetLink().run();
|
|
147
201
|
setOpen(false);
|
|
148
|
-
}, children:
|
|
202
|
+
}, children: locale.removeLink })
|
|
149
203
|
] })
|
|
150
204
|
] })
|
|
151
205
|
] });
|
|
152
206
|
}
|
|
153
|
-
function EditorTools({ editor, disabled, tools = defaults, headingLevels, insertItems = [], variables = [], mentions = [] }) {
|
|
207
|
+
function EditorTools({ editor, disabled, tools = defaults, headingLevels, insertItems = [], variables = [], mentions = [], localeText }) {
|
|
208
|
+
const locale = resolveRichTextEditorLocaleText(localeText);
|
|
154
209
|
const [, refresh] = React.useReducer((value) => value + 1, 0);
|
|
155
210
|
React.useEffect(() => {
|
|
156
211
|
if (!editor) return;
|
|
@@ -163,37 +218,36 @@ function EditorTools({ editor, disabled, tools = defaults, headingLevels, insert
|
|
|
163
218
|
const levels = headingLevels ?? editor?.extensionManager.extensions.find((extension) => extension.name === "heading")?.options.levels ?? [1, 2, 3];
|
|
164
219
|
const format = (label, icon, name, run) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled, "aria-label": label, "aria-pressed": editor?.isActive(name), onMouseDown: (event) => event.preventDefault(), onClick: run, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: icon, size: "sm" }) }, name);
|
|
165
220
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
166
|
-
available("style") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label":
|
|
221
|
+
available("style") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label": locale.blockStyleGroup, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_DropdownMenu.DropdownMenu, { children: [
|
|
167
222
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Control, { disabled, children: [
|
|
168
|
-
|
|
223
|
+
locale.textStyle,
|
|
224
|
+
" ",
|
|
169
225
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "chevron-down", size: "sm" })
|
|
170
226
|
] }) }),
|
|
171
227
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_DropdownMenu.DropdownMenu.Content, { onCloseAutoFocus: (event) => {
|
|
172
228
|
event.preventDefault();
|
|
173
229
|
editor?.commands.focus();
|
|
174
230
|
}, children: [
|
|
175
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().setParagraph().run(), children:
|
|
176
|
-
editor?.schema.nodes.heading ? levels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
] }, level)) : null,
|
|
180
|
-
available("blockquote", "blockquote") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().toggleBlockquote().run(), children: "Quote block" }) : null,
|
|
181
|
-
available("codeBlock", "codeBlock") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().toggleCodeBlock().run(), children: "Code block" }) : null
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().setParagraph().run(), children: locale.paragraph }),
|
|
232
|
+
editor?.schema.nodes.heading ? levels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor.chain().focus().toggleHeading({ level }).run(), children: locale.heading(level) }, level)) : null,
|
|
233
|
+
available("blockquote", "blockquote") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().toggleBlockquote().run(), children: locale.quoteBlock }) : null,
|
|
234
|
+
available("codeBlock", "codeBlock") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Item, { onSelect: () => editor?.chain().focus().toggleCodeBlock().run(), children: locale.codeBlock }) : null
|
|
182
235
|
] })
|
|
183
236
|
] }) }) : null,
|
|
184
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label":
|
|
185
|
-
available("bold", "bold") ? format(
|
|
186
|
-
available("italic", "italic") ? format(
|
|
187
|
-
available("strike", "strike") ? format(
|
|
188
|
-
available("code", "code") ? format(
|
|
189
|
-
available("bulletList", "bulletList") ? format(
|
|
190
|
-
available("orderedList", "orderedList") ? format(
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label": locale.textStyleGroup, children: [
|
|
238
|
+
available("bold", "bold") ? format(locale.bold, "bold", "bold", () => editor?.chain().focus().toggleBold().run()) : null,
|
|
239
|
+
available("italic", "italic") ? format(locale.italic, "italic", "italic", () => editor?.chain().focus().toggleItalic().run()) : null,
|
|
240
|
+
available("strike", "strike") ? format(locale.strikethrough, "strikethrough", "strike", () => editor?.chain().focus().toggleStrike().run()) : null,
|
|
241
|
+
available("code", "code") ? format(locale.inlineCode, "code", "code", () => editor?.chain().focus().toggleCode().run()) : null,
|
|
242
|
+
available("bulletList", "bulletList") ? format(locale.bulletList, "list", "bulletList", () => editor?.chain().focus().toggleBulletList().run()) : null,
|
|
243
|
+
available("orderedList", "orderedList") ? format(locale.orderedList, "list-ordered", "orderedList", () => editor?.chain().focus().toggleOrderedList().run()) : null
|
|
191
244
|
] }),
|
|
192
|
-
editor ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label":
|
|
193
|
-
available("link", "link") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkControl, { editor, disabled }) : null,
|
|
245
|
+
editor ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label": locale.insertGroup, children: [
|
|
246
|
+
available("link", "link") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinkControl, { editor, disabled, localeText }) : null,
|
|
194
247
|
insertItems.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_DropdownMenu.DropdownMenu, { children: [
|
|
195
248
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Control, { disabled, children: [
|
|
196
|
-
|
|
249
|
+
locale.insert,
|
|
250
|
+
" ",
|
|
197
251
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "plus", size: "sm" })
|
|
198
252
|
] }) }),
|
|
199
253
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenu.DropdownMenu.Content, { onCloseAutoFocus: (event) => {
|
|
@@ -212,15 +266,15 @@ function EditorTools({ editor, disabled, tools = defaults, headingLevels, insert
|
|
|
212
266
|
item.insert(editor);
|
|
213
267
|
}, children: item.label }, item.id)) })
|
|
214
268
|
] }) : null,
|
|
215
|
-
variables.length && editor.schema.nodes.dsxVariable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TokenPicker, { editor, disabled, kind: "variable", records: variables }) : null,
|
|
216
|
-
mentions.length && editor.schema.nodes.dsxMention ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TokenPicker, { editor, disabled, kind: "mention", records: mentions }) : null,
|
|
217
|
-
available("clear") ? format(
|
|
269
|
+
variables.length && editor.schema.nodes.dsxVariable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TokenPicker, { editor, disabled, kind: "variable", records: variables, localeText }) : null,
|
|
270
|
+
mentions.length && editor.schema.nodes.dsxMention ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TokenPicker, { editor, disabled, kind: "mention", records: mentions, localeText }) : null,
|
|
271
|
+
available("clear") ? format(locale.clearFormatting, "eraser", "", () => editor.chain().focus().clearNodes().unsetAllMarks().run()) : null
|
|
218
272
|
] }) : null,
|
|
219
|
-
available("history") ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label":
|
|
220
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled: disabled || !editor?.can().undo(), "aria-label":
|
|
221
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled: disabled || !editor?.can().redo(), "aria-label":
|
|
273
|
+
available("history") ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-rich-text-editor__toolbar-group", role: "group", "aria-label": locale.historyGroup, children: [
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled: disabled || !editor?.can().undo(), "aria-label": locale.undo, onMouseDown: (event) => event.preventDefault(), onClick: () => editor?.chain().focus().undo().run(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "undo", size: "sm" }) }),
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Control, { disabled: disabled || !editor?.can().redo(), "aria-label": locale.redo, onMouseDown: (event) => event.preventDefault(), onClick: () => editor?.chain().focus().redo().run(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "redo", size: "sm" }) })
|
|
222
276
|
] }) : null,
|
|
223
|
-
editor && mentions.length && editor.schema.nodes.dsxMention ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MentionSuggestions.MentionSuggestions, { editor, mentions }) : null
|
|
277
|
+
editor && mentions.length && editor.schema.nodes.dsxMention ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MentionSuggestions.MentionSuggestions, { editor, mentions, localeText }) : null
|
|
224
278
|
] });
|
|
225
279
|
}
|
|
226
280
|
//# sourceMappingURL=EditorTools.cjs.map
|