@dsn-starter-kit/components-react 3.5.0 → 4.1.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/Card/Card.d.mts +86 -21
- package/dist/Card/Card.d.mts.map +1 -1
- package/dist/Card/Card2.mjs +100 -17
- package/dist/Card/Card2.mjs.map +1 -1
- package/dist/Card/index.d.mts +2 -2
- package/dist/DateInput/DateInput.d.mts +1 -1
- package/dist/DateInput/DateInput2.mjs +1 -1
- package/dist/DateInput/DateInput2.mjs.map +1 -1
- package/dist/DateInputGroup/DateInputGroup2.mjs +3 -3
- package/dist/DateInputGroup/DateInputGroup2.mjs.map +1 -1
- package/dist/Drawer/Drawer.d.mts +5 -2
- package/dist/Drawer/Drawer.d.mts.map +1 -1
- package/dist/Drawer/Drawer2.mjs +18 -3
- package/dist/Drawer/Drawer2.mjs.map +1 -1
- package/dist/EmailInput/EmailInput.d.mts +10 -5
- package/dist/EmailInput/EmailInput.d.mts.map +1 -1
- package/dist/EmailInput/EmailInput2.mjs +2 -2
- package/dist/EmailInput/EmailInput2.mjs.map +1 -1
- package/dist/ModalDialog/ModalDialog.d.mts +13 -3
- package/dist/ModalDialog/ModalDialog.d.mts.map +1 -1
- package/dist/ModalDialog/ModalDialog2.mjs +10 -3
- package/dist/ModalDialog/ModalDialog2.mjs.map +1 -1
- package/dist/NumberInput/NumberInput.d.mts +4 -4
- package/dist/NumberInput/NumberInput.d.mts.map +1 -1
- package/dist/NumberInput/NumberInput2.mjs +2 -2
- package/dist/NumberInput/NumberInput2.mjs.map +1 -1
- package/dist/PageHeader/PageHeader.d.mts.map +1 -1
- package/dist/PageHeader/PageHeader2.mjs +19 -2
- package/dist/PageHeader/PageHeader2.mjs.map +1 -1
- package/dist/PasswordInput/PasswordInput.d.mts +10 -5
- package/dist/PasswordInput/PasswordInput.d.mts.map +1 -1
- package/dist/PasswordInput/PasswordInput2.mjs +2 -2
- package/dist/PasswordInput/PasswordInput2.mjs.map +1 -1
- package/dist/Popover/Popover.d.mts +16 -23
- package/dist/Popover/Popover.d.mts.map +1 -1
- package/dist/Popover/Popover2.mjs +33 -119
- package/dist/Popover/Popover2.mjs.map +1 -1
- package/dist/PopoverMenu/PopoverMenu.d.mts +62 -0
- package/dist/PopoverMenu/PopoverMenu.d.mts.map +1 -0
- package/dist/PopoverMenu/PopoverMenu2.mjs +66 -0
- package/dist/PopoverMenu/PopoverMenu2.mjs.map +1 -0
- package/dist/PopoverMenu/index.d.mts +2 -0
- package/dist/SearchInput/SearchInput.d.mts +10 -5
- package/dist/SearchInput/SearchInput.d.mts.map +1 -1
- package/dist/SearchInput/SearchInput2.mjs +2 -2
- package/dist/SearchInput/SearchInput2.mjs.map +1 -1
- package/dist/Select/Select.d.mts +6 -6
- package/dist/Select/Select.d.mts.map +1 -1
- package/dist/Select/Select2.mjs +4 -4
- package/dist/Select/Select2.mjs.map +1 -1
- package/dist/TelephoneInput/TelephoneInput.d.mts +10 -5
- package/dist/TelephoneInput/TelephoneInput.d.mts.map +1 -1
- package/dist/TelephoneInput/TelephoneInput2.mjs +2 -2
- package/dist/TelephoneInput/TelephoneInput2.mjs.map +1 -1
- package/dist/TextArea/TextArea.d.mts +10 -5
- package/dist/TextArea/TextArea.d.mts.map +1 -1
- package/dist/TextArea/TextArea2.mjs +2 -2
- package/dist/TextArea/TextArea2.mjs.map +1 -1
- package/dist/TextInput/TextInput.d.mts +4 -4
- package/dist/TextInput/TextInput.d.mts.map +1 -1
- package/dist/TextInput/TextInput2.mjs +2 -2
- package/dist/TextInput/TextInput2.mjs.map +1 -1
- package/dist/TimeInput/TimeInput.d.mts +1 -1
- package/dist/TimeInput/TimeInput2.mjs +1 -1
- package/dist/TimeInput/TimeInput2.mjs.map +1 -1
- package/dist/index.cjs +315 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5950 -5217
- package/dist/index.d.cts +243 -66
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +3 -2
- package/dist/utils/popover.d.mts +27 -0
- package/dist/utils/popover.d.mts.map +1 -0
- package/dist/utils/popover.mjs +142 -0
- package/dist/utils/popover.mjs.map +1 -0
- package/package.json +3 -3
package/dist/Select/Select2.mjs
CHANGED
|
@@ -27,15 +27,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
27
27
|
* </Select>
|
|
28
28
|
* </FormField>
|
|
29
29
|
*
|
|
30
|
-
* //
|
|
31
|
-
* <Select
|
|
30
|
+
* // Inline-size variant
|
|
31
|
+
* <Select inlineSize="lg">...</Select>
|
|
32
32
|
*
|
|
33
33
|
* // Invalid state
|
|
34
34
|
* <Select invalid aria-invalid="true" aria-describedby="error">...</Select>
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
const Select = React.forwardRef(({ className, invalid,
|
|
38
|
-
const wrapperClasses = classNames("dsn-select-wrapper",
|
|
37
|
+
const Select = React.forwardRef(({ className, invalid, inlineSize, disabled, children, ...props }, ref) => {
|
|
38
|
+
const wrapperClasses = classNames("dsn-select-wrapper", inlineSize && `dsn-select-wrapper--inline-size-${inlineSize}`);
|
|
39
39
|
const selectClasses = classNames("dsn-text-input", "dsn-select", className);
|
|
40
40
|
return /* @__PURE__ */ jsxs("div", {
|
|
41
41
|
className: wrapperClasses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select2.mjs","names":[],"sources":["../../src/Select/Select.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames,
|
|
1
|
+
{"version":3,"file":"Select2.mjs","names":[],"sources":["../../src/Select/Select.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, FormControlInlineSize } from '@dsn-starter-kit/core';\nimport { Icon } from '../Icon';\nimport './Select.css';\n\nexport interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {\n /**\n * Whether the select is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Inline-size variant for the select\n * @default undefined (uses default max-inline-size from form-control)\n */\n inlineSize?: FormControlInlineSize;\n\n /**\n * Additional CSS class names\n */\n className?: string;\n}\n\n/**\n * Select component\n * Dropdown select with a custom chevron-down icon at inline-end.\n * The native select arrow is hidden; the custom icon is decorative and non-interactive.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Select>\n * <option value=\"\">Kies een optie</option>\n * <option value=\"1\">Optie 1</option>\n * <option value=\"2\">Optie 2</option>\n * </Select>\n *\n * // With label\n * <FormField label=\"Land\" htmlFor=\"land\">\n * <Select id=\"land\">\n * <option value=\"\">Kies een land</option>\n * <option value=\"nl\">Nederland</option>\n * <option value=\"be\">België</option>\n * </Select>\n * </FormField>\n *\n * // Inline-size variant\n * <Select inlineSize=\"lg\">...</Select>\n *\n * // Invalid state\n * <Select invalid aria-invalid=\"true\" aria-describedby=\"error\">...</Select>\n * ```\n */\nexport const Select = React.forwardRef<HTMLSelectElement, SelectProps>(\n ({ className, invalid, inlineSize, disabled, children, ...props }, ref) => {\n const wrapperClasses = classNames(\n 'dsn-select-wrapper',\n inlineSize && `dsn-select-wrapper--inline-size-${inlineSize}`\n );\n\n const selectClasses = classNames('dsn-text-input', 'dsn-select', className);\n\n return (\n <div className={wrapperClasses}>\n <select\n ref={ref}\n className={selectClasses}\n aria-invalid={invalid || undefined}\n disabled={disabled}\n {...props}\n >\n {children}\n </select>\n {!disabled && (\n <Icon name=\"chevron-down\" className=\"dsn-select__icon\" aria-hidden />\n )}\n </div>\n );\n }\n);\n\nSelect.displayName = 'Select';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,SAAS,MAAM,YACzB,EAAE,WAAW,SAAS,YAAY,UAAU,UAAU,GAAG,SAAS,QAAQ;CACzE,MAAM,iBAAiB,WACrB,sBACA,cAAc,mCAAmC,YACnD;CAEA,MAAM,gBAAgB,WAAW,kBAAkB,cAAc,SAAS;CAE1E,OACE,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,oBAAC,UAAD;GACO;GACL,WAAW;GACX,gBAAc,WAAW,KAAA;GACf;GACV,GAAI;GAEH;EACK,CAAA,GACP,CAAC,YACA,oBAAC,MAAD;GAAM,MAAK;GAAe,WAAU;GAAmB,eAAA;EAAa,CAAA,CAEnE;;AAET,CACF;AAEA,OAAO,cAAc"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlInlineSize } from "@dsn-starter-kit/core";
|
|
3
3
|
//#region src/TelephoneInput/TelephoneInput.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Inline-size variants offered by TelephoneInput. xs and sm are left out: they
|
|
6
|
+
* are too narrow for the content this field is meant for.
|
|
7
|
+
*/
|
|
8
|
+
type TelephoneInputInlineSize = Exclude<FormControlInlineSize, 'xs' | 'sm'>;
|
|
4
9
|
interface TelephoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
5
10
|
/**
|
|
6
11
|
* Whether the input is in an invalid state
|
|
@@ -8,10 +13,10 @@ interface TelephoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
8
13
|
*/
|
|
9
14
|
invalid?: boolean;
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @default
|
|
16
|
+
* Inline-size variant for the input (md, lg, xl or full)
|
|
17
|
+
* @default 'md'
|
|
13
18
|
*/
|
|
14
|
-
|
|
19
|
+
inlineSize?: TelephoneInputInlineSize;
|
|
15
20
|
/**
|
|
16
21
|
* Additional CSS class names
|
|
17
22
|
*/
|
|
@@ -36,5 +41,5 @@ interface TelephoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
36
41
|
*/
|
|
37
42
|
declare const TelephoneInput: React.ForwardRefExoticComponent<TelephoneInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
38
43
|
//#endregion
|
|
39
|
-
export { TelephoneInput, TelephoneInputProps };
|
|
44
|
+
export { TelephoneInput, TelephoneInputInlineSize, TelephoneInputProps };
|
|
40
45
|
//# sourceMappingURL=TelephoneInput.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelephoneInput.d.mts","names":[],"sources":["../../src/TelephoneInput/TelephoneInput.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TelephoneInput.d.mts","names":[],"sources":["../../src/TelephoneInput/TelephoneInput.tsx"],"mappings":";;;;;;;KAQY,2BAA2B,QACrC;UAIe,4BAA4B,KAC3C,MAAM,oBAAoB;;;;;EAO1B;;;;;EAMA,aAAa;;;;EAKb;;;;;;;;;;;;;;;;;;;cAoBW,gBAAc,MAAA,0BAAA,sBAAA,MAAA,cAAA"}
|
|
@@ -20,8 +20,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* <TelephoneInput invalid aria-invalid="true" aria-describedby="error" />
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
const TelephoneInput = React.forwardRef(({ className, invalid,
|
|
24
|
-
const classes = classNames("dsn-text-input",
|
|
23
|
+
const TelephoneInput = React.forwardRef(({ className, invalid, inlineSize = "md", autoComplete, ...props }, ref) => {
|
|
24
|
+
const classes = classNames("dsn-text-input", inlineSize && `dsn-text-input--inline-size-${inlineSize}`, className);
|
|
25
25
|
return /* @__PURE__ */ jsx("input", {
|
|
26
26
|
ref,
|
|
27
27
|
type: "tel",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelephoneInput2.mjs","names":[],"sources":["../../src/TelephoneInput/TelephoneInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames,
|
|
1
|
+
{"version":3,"file":"TelephoneInput2.mjs","names":[],"sources":["../../src/TelephoneInput/TelephoneInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, FormControlInlineSize } from '@dsn-starter-kit/core';\nimport './TelephoneInput.css';\n\n/**\n * Inline-size variants offered by TelephoneInput. xs and sm are left out: they\n * are too narrow for the content this field is meant for.\n */\nexport type TelephoneInputInlineSize = Exclude<\n FormControlInlineSize,\n 'xs' | 'sm'\n>;\n\nexport interface TelephoneInputProps extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type'\n> {\n /**\n * Whether the input is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Inline-size variant for the input (md, lg, xl or full)\n * @default 'md'\n */\n inlineSize?: TelephoneInputInlineSize;\n\n /**\n * Additional CSS class names\n */\n className?: string;\n}\n\n/**\n * Telephone Input component\n * Telephone input with appropriate inputmode and autocomplete\n *\n * @example\n * ```tsx\n * // Basic usage\n * <TelephoneInput placeholder=\"06 12345678\" />\n *\n * // With label\n * <FormFieldLabel htmlFor=\"phone\">Telefoonnummer</FormFieldLabel>\n * <TelephoneInput id=\"phone\" />\n *\n * // Invalid state\n * <TelephoneInput invalid aria-invalid=\"true\" aria-describedby=\"error\" />\n * ```\n */\nexport const TelephoneInput = React.forwardRef<\n HTMLInputElement,\n TelephoneInputProps\n>(({ className, invalid, inlineSize = 'md', autoComplete, ...props }, ref) => {\n const classes = classNames(\n 'dsn-text-input',\n inlineSize && `dsn-text-input--inline-size-${inlineSize}`,\n className\n );\n\n return (\n <input\n ref={ref}\n type=\"tel\"\n inputMode=\"tel\"\n className={classes}\n autoComplete={autoComplete || 'tel'}\n aria-invalid={invalid || undefined}\n {...props}\n />\n );\n});\n\nTelephoneInput.displayName = 'TelephoneInput';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAa,iBAAiB,MAAM,YAGjC,EAAE,WAAW,SAAS,aAAa,MAAM,cAAc,GAAG,SAAS,QAAQ;CAC5E,MAAM,UAAU,WACd,kBACA,cAAc,+BAA+B,cAC7C,SACF;CAEA,OACE,oBAAC,SAAD;EACO;EACL,MAAK;EACL,WAAU;EACV,WAAW;EACX,cAAc,gBAAgB;EAC9B,gBAAc,WAAW,KAAA;EACzB,GAAI;CACL,CAAA;AAEL,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlInlineSize } from "@dsn-starter-kit/core";
|
|
3
3
|
//#region src/TextArea/TextArea.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Inline-size variants offered by TextArea. xs and sm are left out: they
|
|
6
|
+
* are too narrow for the content this field is meant for.
|
|
7
|
+
*/
|
|
8
|
+
type TextAreaInlineSize = Exclude<FormControlInlineSize, 'xs' | 'sm'>;
|
|
4
9
|
interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
5
10
|
/**
|
|
6
11
|
* Additional CSS class names
|
|
@@ -12,10 +17,10 @@ interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
12
17
|
*/
|
|
13
18
|
invalid?: boolean;
|
|
14
19
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @default undefined (uses default max-
|
|
20
|
+
* Inline-size variant for the textarea (md, lg, xl or full)
|
|
21
|
+
* @default undefined (uses default max-inline-size from form-control)
|
|
17
22
|
*/
|
|
18
|
-
|
|
23
|
+
inlineSize?: TextAreaInlineSize;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Text Area component
|
|
@@ -42,5 +47,5 @@ interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
42
47
|
*/
|
|
43
48
|
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
44
49
|
//#endregion
|
|
45
|
-
export { TextArea, TextAreaProps };
|
|
50
|
+
export { TextArea, TextAreaInlineSize, TextAreaProps };
|
|
46
51
|
//# sourceMappingURL=TextArea.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.mts","names":[],"sources":["../../src/TextArea/TextArea.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.d.mts","names":[],"sources":["../../src/TextArea/TextArea.tsx"],"mappings":";;;;;;;KAQY,qBAAqB,QAAQ;UAExB,sBAAsB,MAAM,uBAAuB;;;;EAIlE;;;;;EAMA;;;;;EAMA,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;cA0BF,UAAQ,MAAA,0BAAA,gBAAA,MAAA,cAAA"}
|
|
@@ -26,8 +26,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
26
26
|
* <TextArea readOnly value="View only" rows={3} />
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
const TextArea = React.forwardRef(({ className, invalid,
|
|
30
|
-
const classes = classNames("dsn-text-area",
|
|
29
|
+
const TextArea = React.forwardRef(({ className, invalid, inlineSize, rows = 4, ...props }, ref) => {
|
|
30
|
+
const classes = classNames("dsn-text-area", inlineSize && `dsn-text-area--inline-size-${inlineSize}`, className);
|
|
31
31
|
return /* @__PURE__ */ jsx("textarea", {
|
|
32
32
|
ref,
|
|
33
33
|
className: classes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea2.mjs","names":[],"sources":["../../src/TextArea/TextArea.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames,
|
|
1
|
+
{"version":3,"file":"TextArea2.mjs","names":[],"sources":["../../src/TextArea/TextArea.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, FormControlInlineSize } from '@dsn-starter-kit/core';\nimport './TextArea.css';\n\n/**\n * Inline-size variants offered by TextArea. xs and sm are left out: they\n * are too narrow for the content this field is meant for.\n */\nexport type TextAreaInlineSize = Exclude<FormControlInlineSize, 'xs' | 'sm'>;\n\nexport interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /**\n * Additional CSS class names\n */\n className?: string;\n\n /**\n * Whether the textarea is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Inline-size variant for the textarea (md, lg, xl or full)\n * @default undefined (uses default max-inline-size from form-control)\n */\n inlineSize?: TextAreaInlineSize;\n}\n\n/**\n * Text Area component\n * Multi-line text input with support for various states (hover, focus, disabled, invalid, read-only)\n *\n * @example\n * ```tsx\n * // Basic usage\n * <TextArea placeholder=\"Enter your bio\" rows={4} />\n *\n * // With label\n * <FormFieldLabel htmlFor=\"bio\">Biography</FormFieldLabel>\n * <TextArea id=\"bio\" rows={6} />\n *\n * // Disabled\n * <TextArea disabled value=\"Cannot edit\" rows={3} />\n *\n * // Invalid\n * <TextArea invalid aria-invalid=\"true\" aria-describedby=\"error\" rows={4} />\n *\n * // Read-only\n * <TextArea readOnly value=\"View only\" rows={3} />\n * ```\n */\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ className, invalid, inlineSize, rows = 4, ...props }, ref) => {\n const classes = classNames(\n 'dsn-text-area',\n inlineSize && `dsn-text-area--inline-size-${inlineSize}`,\n className\n );\n\n return (\n <textarea\n ref={ref}\n className={classes}\n rows={rows}\n aria-invalid={invalid || undefined}\n {...props}\n />\n );\n }\n);\n\nTextArea.displayName = 'TextArea';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAa,WAAW,MAAM,YAC3B,EAAE,WAAW,SAAS,YAAY,OAAO,GAAG,GAAG,SAAS,QAAQ;CAC/D,MAAM,UAAU,WACd,iBACA,cAAc,8BAA8B,cAC5C,SACF;CAEA,OACE,oBAAC,YAAD;EACO;EACL,WAAW;EACL;EACN,gBAAc,WAAW,KAAA;EACzB,GAAI;CACL,CAAA;AAEL,CACF;AAEA,SAAS,cAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlInlineSize } from "@dsn-starter-kit/core";
|
|
3
3
|
//#region src/TextInput/TextInput.d.ts
|
|
4
4
|
interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
5
|
/**
|
|
@@ -12,10 +12,10 @@ interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
12
12
|
*/
|
|
13
13
|
invalid?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @default undefined (uses default max-
|
|
15
|
+
* Inline-size variant for the input
|
|
16
|
+
* @default undefined (uses default max-inline-size from form-control)
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
inlineSize?: FormControlInlineSize;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Text Input component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.mts","names":[],"sources":["../../src/TextInput/TextInput.tsx"],"mappings":";;;UAIiB,uBAAuB,MAAM,oBAAoB;;;;EAIhE;;;;;EAMA;;;;;EAMA,
|
|
1
|
+
{"version":3,"file":"TextInput.d.mts","names":[],"sources":["../../src/TextInput/TextInput.tsx"],"mappings":";;;UAIiB,uBAAuB,MAAM,oBAAoB;;;;EAIhE;;;;;EAMA;;;;;EAMA,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;cA0BF,WAAS,MAAA,0BAAA,iBAAA,MAAA,cAAA"}
|
|
@@ -26,8 +26,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
26
26
|
* <TextInput readOnly value="Cannot edit this" />
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
const TextInput = React.forwardRef(({ className, invalid,
|
|
30
|
-
const classes = classNames("dsn-text-input",
|
|
29
|
+
const TextInput = React.forwardRef(({ className, invalid, inlineSize, type = "text", ...props }, ref) => {
|
|
30
|
+
const classes = classNames("dsn-text-input", inlineSize && `dsn-text-input--inline-size-${inlineSize}`, className);
|
|
31
31
|
return /* @__PURE__ */ jsx("input", {
|
|
32
32
|
ref,
|
|
33
33
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput2.mjs","names":[],"sources":["../../src/TextInput/TextInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames,
|
|
1
|
+
{"version":3,"file":"TextInput2.mjs","names":[],"sources":["../../src/TextInput/TextInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, FormControlInlineSize } from '@dsn-starter-kit/core';\nimport './TextInput.css';\n\nexport interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /**\n * Additional CSS class names\n */\n className?: string;\n\n /**\n * Whether the input is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Inline-size variant for the input\n * @default undefined (uses default max-inline-size from form-control)\n */\n inlineSize?: FormControlInlineSize;\n}\n\n/**\n * Text Input component\n * Single-line text input with support for various states (hover, focus, disabled, invalid, read-only)\n *\n * @example\n * ```tsx\n * // Basic usage\n * <TextInput placeholder=\"Enter your name\" />\n *\n * // With label\n * <FormFieldLabel htmlFor=\"email\">Email</FormFieldLabel>\n * <TextInput id=\"email\" type=\"email\" />\n *\n * // Disabled\n * <TextInput disabled value=\"Read only value\" />\n *\n * // Invalid\n * <TextInput invalid aria-invalid=\"true\" aria-describedby=\"error\" />\n *\n * // Read-only\n * <TextInput readOnly value=\"Cannot edit this\" />\n * ```\n */\nexport const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(\n ({ className, invalid, inlineSize, type = 'text', ...props }, ref) => {\n const classes = classNames(\n 'dsn-text-input',\n inlineSize && `dsn-text-input--inline-size-${inlineSize}`,\n className\n );\n\n return (\n <input\n ref={ref}\n type={type}\n className={classes}\n aria-invalid={invalid || undefined}\n {...props}\n />\n );\n }\n);\n\nTextInput.displayName = 'TextInput';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,YAAY,MAAM,YAC5B,EAAE,WAAW,SAAS,YAAY,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACpE,MAAM,UAAU,WACd,kBACA,cAAc,+BAA+B,cAC7C,SACF;CAEA,OACE,oBAAC,SAAD;EACO;EACC;EACN,WAAW;EACX,gBAAc,WAAW,KAAA;EACzB,GAAI;CACL,CAAA;AAEL,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -14,7 +14,7 @@ interface TimeInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
|
|
|
14
14
|
/**
|
|
15
15
|
* Time Input component
|
|
16
16
|
* Time input with an interactive clock button at inline-end that opens the native time picker.
|
|
17
|
-
* Fixed
|
|
17
|
+
* Fixed inline-size (sm): not configurable, as time inputs have a predictable content length.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```tsx
|
|
@@ -8,7 +8,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
/**
|
|
9
9
|
* Time Input component
|
|
10
10
|
* Time input with an interactive clock button at inline-end that opens the native time picker.
|
|
11
|
-
* Fixed
|
|
11
|
+
* Fixed inline-size (sm): not configurable, as time inputs have a predictable content length.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput2.mjs","names":[],"sources":["../../src/TimeInput/TimeInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@dsn-starter-kit/core';\nimport { Button } from '../Button';\nimport { Icon } from '../Icon';\nimport './TimeInput.css';\n\nexport interface TimeInputProps extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type'\n> {\n /**\n * Whether the input is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Additional CSS class names\n */\n className?: string;\n}\n\n/**\n * Time Input component\n * Time input with an interactive clock button at inline-end that opens the native time picker.\n * Fixed
|
|
1
|
+
{"version":3,"file":"TimeInput2.mjs","names":[],"sources":["../../src/TimeInput/TimeInput.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames } from '@dsn-starter-kit/core';\nimport { Button } from '../Button';\nimport { Icon } from '../Icon';\nimport './TimeInput.css';\n\nexport interface TimeInputProps extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type'\n> {\n /**\n * Whether the input is in an invalid state\n * @default false\n */\n invalid?: boolean;\n\n /**\n * Additional CSS class names\n */\n className?: string;\n}\n\n/**\n * Time Input component\n * Time input with an interactive clock button at inline-end that opens the native time picker.\n * Fixed inline-size (sm): not configurable, as time inputs have a predictable content length.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <TimeInput />\n *\n * // With label\n * <FormFieldLabel htmlFor=\"time\">Tijd</FormFieldLabel>\n * <TimeInput id=\"time\" />\n *\n * // With default value\n * <TimeInput defaultValue=\"14:30\" />\n *\n * // Invalid state\n * <TimeInput invalid aria-invalid=\"true\" aria-describedby=\"error\" />\n * ```\n */\nexport const TimeInput = React.forwardRef<HTMLInputElement, TimeInputProps>(\n ({ className, invalid, disabled, readOnly, ...props }, ref) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // Merge external ref with internal ref\n const handleRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n }\n },\n [ref]\n );\n\n const handleButtonClick = () => {\n if (inputRef.current && 'showPicker' in inputRef.current) {\n inputRef.current.showPicker();\n }\n };\n\n const inputClasses = classNames(\n 'dsn-text-input',\n 'dsn-time-input',\n className\n );\n\n return (\n <div className=\"dsn-time-input-wrapper\">\n <input\n ref={handleRef}\n type=\"time\"\n className={inputClasses}\n aria-invalid={invalid || undefined}\n disabled={disabled}\n readOnly={readOnly}\n {...props}\n />\n {!disabled && !readOnly && (\n <Button\n variant=\"subtle\"\n size=\"small\"\n iconOnly\n iconStart={<Icon name=\"clock\" aria-hidden />}\n className=\"dsn-time-input__button\"\n onClick={handleButtonClick}\n >\n Tijdkiezer openen\n </Button>\n )}\n </div>\n );\n }\n);\n\nTimeInput.displayName = 'TimeInput';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,YAAY,MAAM,YAC5B,EAAE,WAAW,SAAS,UAAU,UAAU,GAAG,SAAS,QAAQ;CAC7D,MAAM,WAAW,MAAM,OAAyB,IAAI;CAGpD,MAAM,YAAY,MAAM,aACrB,SAAkC;EACjC,SAA8D,UAC5D;EACF,IAAI,OAAO,QAAQ,YACjB,IAAI,IAAI;OACH,IAAI,KACT,IAAyD,UACvD;CAEN,GACA,CAAC,GAAG,CACN;CAEA,MAAM,0BAA0B;EAC9B,IAAI,SAAS,WAAW,gBAAgB,SAAS,SAC/C,SAAS,QAAQ,WAAW;CAEhC;CAEA,MAAM,eAAe,WACnB,kBACA,kBACA,SACF;CAEA,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,SAAD;GACE,KAAK;GACL,MAAK;GACL,WAAW;GACX,gBAAc,WAAW,KAAA;GACf;GACA;GACV,GAAI;EACL,CAAA,GACA,CAAC,YAAY,CAAC,YACb,oBAAC,QAAD;GACE,SAAQ;GACR,MAAK;GACL,UAAA;GACA,WAAW,oBAAC,MAAD;IAAM,MAAK;IAAQ,eAAA;GAAa,CAAA;GAC3C,WAAU;GACV,SAAS;GACV,UAAA;EAEO,CAAA,CAEP;;AAET,CACF;AAEA,UAAU,cAAc"}
|