@donotdev/components 0.0.11 → 0.0.13
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/advanced/Bento/Bento.d.ts +0 -9
- package/dist/advanced/Bento/Bento.d.ts.map +1 -1
- package/dist/advanced/Bento/Bento.js +10 -0
- package/dist/advanced/Code/Code.d.ts +1 -9
- package/dist/advanced/Code/Code.d.ts.map +1 -1
- package/dist/atomic/Accordion/index.d.ts.map +1 -1
- package/dist/atomic/Accordion/index.js +1 -1
- package/dist/atomic/ActionButton/index.d.ts.map +1 -1
- package/dist/atomic/AlertDialog/AlertDialogPrimitive.d.ts.map +1 -1
- package/dist/atomic/AlertDialog/index.js +2 -2
- package/dist/atomic/Avatar/AvatarPrimitive.d.ts +1 -1
- package/dist/atomic/Avatar/AvatarPrimitive.d.ts.map +1 -1
- package/dist/atomic/Avatar/AvatarPrimitive.js +0 -1
- package/dist/atomic/Blockquote/index.d.ts +1 -9
- package/dist/atomic/Blockquote/index.d.ts.map +1 -1
- package/dist/atomic/Button/index.d.ts +18 -1
- package/dist/atomic/Button/index.d.ts.map +1 -1
- package/dist/atomic/Button/index.js +19 -6
- package/dist/atomic/Calendar/index.d.ts.map +1 -1
- package/dist/atomic/Calendar/index.js +4 -3
- package/dist/atomic/Checkbox/CheckboxPrimitive.d.ts +1 -1
- package/dist/atomic/Checkbox/CheckboxPrimitive.d.ts.map +1 -1
- package/dist/atomic/Checkbox/CheckboxPrimitive.js +0 -1
- package/dist/atomic/Checkbox/index.d.ts +1 -1
- package/dist/atomic/Checkbox/index.d.ts.map +1 -1
- package/dist/atomic/Checkbox/index.js +2 -2
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts +1 -1
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts.map +1 -1
- package/dist/atomic/Collapsible/CollapsiblePrimitive.js +0 -1
- package/dist/atomic/Collapsible/index.d.ts.map +1 -1
- package/dist/atomic/Collapsible/index.js +2 -6
- package/dist/atomic/Combobox/index.d.ts +9 -47
- package/dist/atomic/Combobox/index.d.ts.map +1 -1
- package/dist/atomic/Combobox/index.js +136 -88
- package/dist/atomic/CommandDialog/index.d.ts.map +1 -1
- package/dist/atomic/CommandDialog/index.js +1 -1
- package/dist/atomic/ContextMenu/ContextMenuPrimitive.d.ts +1 -1
- package/dist/atomic/ContextMenu/ContextMenuPrimitive.d.ts.map +1 -1
- package/dist/atomic/ContextMenu/ContextMenuPrimitive.js +0 -1
- package/dist/atomic/ContextMenu/index.d.ts.map +1 -1
- package/dist/atomic/Dialog/DialogPrimitive.d.ts.map +1 -1
- package/dist/atomic/Dialog/index.d.ts.map +1 -1
- package/dist/atomic/Dialog/index.js +2 -2
- package/dist/atomic/DropdownMenu/index.d.ts.map +1 -1
- package/dist/atomic/DropdownMenu/index.js +18 -4
- package/dist/atomic/DualCard/index.d.ts +10 -2
- package/dist/atomic/DualCard/index.d.ts.map +1 -1
- package/dist/atomic/DualCard/index.js +3 -3
- package/dist/atomic/FeatureFallback/index.js +1 -1
- package/dist/atomic/HoverCard/HoverCardPrimitive.d.ts +1 -1
- package/dist/atomic/HoverCard/HoverCardPrimitive.d.ts.map +1 -1
- package/dist/atomic/HoverCard/HoverCardPrimitive.js +0 -1
- package/dist/atomic/HoverCard/index.js +1 -1
- package/dist/atomic/Input/index.d.ts +1 -1
- package/dist/atomic/Input/index.d.ts.map +1 -1
- package/dist/atomic/Input/index.js +13 -22
- package/dist/atomic/Label/FloatingLabel.d.ts +45 -0
- package/dist/atomic/Label/FloatingLabel.d.ts.map +1 -0
- package/dist/atomic/Label/FloatingLabel.js +34 -0
- package/dist/atomic/Label/index.d.ts +5 -1
- package/dist/atomic/Label/index.d.ts.map +1 -1
- package/dist/atomic/Label/index.js +8 -2
- package/dist/atomic/List/index.d.ts +8 -0
- package/dist/atomic/List/index.d.ts.map +1 -1
- package/dist/atomic/List/index.js +1 -1
- package/dist/atomic/NavigationMenu/NavigationMenuPrimitive.d.ts +1 -1
- package/dist/atomic/NavigationMenu/NavigationMenuPrimitive.d.ts.map +1 -1
- package/dist/atomic/NavigationMenu/NavigationMenuPrimitive.js +0 -1
- package/dist/atomic/NavigationMenu/index.d.ts +1 -1
- package/dist/atomic/NavigationMenu/index.d.ts.map +1 -1
- package/dist/atomic/NavigationMenu/index.js +10 -1
- package/dist/atomic/Pagination/index.d.ts +1 -1
- package/dist/atomic/Pagination/index.d.ts.map +1 -1
- package/dist/atomic/PasswordInput/index.d.ts +9 -10
- package/dist/atomic/PasswordInput/index.d.ts.map +1 -1
- package/dist/atomic/PasswordInput/index.js +14 -30
- package/dist/atomic/Popover/index.d.ts +0 -8
- package/dist/atomic/Popover/index.d.ts.map +1 -1
- package/dist/atomic/Popover/index.js +1 -1
- package/dist/atomic/PortalButton/index.d.ts +8 -0
- package/dist/atomic/PortalButton/index.d.ts.map +1 -1
- package/dist/atomic/PortalButton/index.js +1 -1
- package/dist/atomic/Progress/ProgressPrimitive.d.ts +1 -1
- package/dist/atomic/Progress/ProgressPrimitive.d.ts.map +1 -1
- package/dist/atomic/Progress/ProgressPrimitive.js +0 -1
- package/dist/atomic/Progress/index.d.ts +8 -0
- package/dist/atomic/Progress/index.d.ts.map +1 -1
- package/dist/atomic/Progress/index.js +1 -1
- package/dist/atomic/RadioGroup/index.d.ts +0 -9
- package/dist/atomic/RadioGroup/index.d.ts.map +1 -1
- package/dist/atomic/RadioGroup/index.js +2 -2
- package/dist/atomic/ScrollArea/ScrollAreaPrimitive.d.ts +1 -1
- package/dist/atomic/ScrollArea/ScrollAreaPrimitive.d.ts.map +1 -1
- package/dist/atomic/ScrollArea/ScrollAreaPrimitive.js +0 -1
- package/dist/atomic/Section/index.d.ts +0 -32
- package/dist/atomic/Section/index.d.ts.map +1 -1
- package/dist/atomic/Section/index.js +6 -7
- package/dist/atomic/Select/SelectPrimitive.d.ts +1 -1
- package/dist/atomic/Select/SelectPrimitive.d.ts.map +1 -1
- package/dist/atomic/Select/SelectPrimitive.js +0 -1
- package/dist/atomic/Select/index.d.ts +3 -1
- package/dist/atomic/Select/index.d.ts.map +1 -1
- package/dist/atomic/Select/index.js +14 -24
- package/dist/atomic/Separator/SeparatorPrimitive.d.ts +1 -1
- package/dist/atomic/Separator/SeparatorPrimitive.d.ts.map +1 -1
- package/dist/atomic/Separator/SeparatorPrimitive.js +0 -1
- package/dist/atomic/Separator/index.d.ts +1 -1
- package/dist/atomic/Separator/index.d.ts.map +1 -1
- package/dist/atomic/Separator/index.js +0 -1
- package/dist/atomic/Sheet/index.d.ts +3 -1
- package/dist/atomic/Sheet/index.d.ts.map +1 -1
- package/dist/atomic/Sheet/index.js +3 -3
- package/dist/atomic/Skeleton/index.d.ts.map +1 -1
- package/dist/atomic/Skeleton/index.js +6 -3
- package/dist/atomic/Slider/SliderPrimitive.d.ts +1 -1
- package/dist/atomic/Slider/SliderPrimitive.d.ts.map +1 -1
- package/dist/atomic/Slider/SliderPrimitive.js +0 -1
- package/dist/atomic/Slider/index.d.ts +3 -2
- package/dist/atomic/Slider/index.d.ts.map +1 -1
- package/dist/atomic/Slider/index.js +2 -3
- package/dist/atomic/Slot/index.d.ts.map +1 -1
- package/dist/atomic/Stepper/index.js +1 -1
- package/dist/atomic/Switch/SwitchPrimitive.d.ts +1 -1
- package/dist/atomic/Switch/SwitchPrimitive.d.ts.map +1 -1
- package/dist/atomic/Switch/SwitchPrimitive.js +0 -1
- package/dist/atomic/Switch/index.d.ts +21 -6
- package/dist/atomic/Switch/index.d.ts.map +1 -1
- package/dist/atomic/Switch/index.js +27 -9
- package/dist/atomic/Table/index.d.ts +19 -7
- package/dist/atomic/Table/index.d.ts.map +1 -1
- package/dist/atomic/Table/index.js +25 -5
- package/dist/atomic/Tabs/TabsPrimitive.d.ts +1 -1
- package/dist/atomic/Tabs/TabsPrimitive.d.ts.map +1 -1
- package/dist/atomic/Tabs/TabsPrimitive.js +0 -1
- package/dist/atomic/Tabs/index.js +1 -1
- package/dist/atomic/Tag/index.d.ts +8 -0
- package/dist/atomic/Tag/index.d.ts.map +1 -1
- package/dist/atomic/Tag/index.js +1 -1
- package/dist/atomic/Text/index.js +1 -1
- package/dist/atomic/Textarea/index.d.ts.map +1 -1
- package/dist/atomic/ToggleGroup/ToggleGroupPrimitive.d.ts +1 -1
- package/dist/atomic/ToggleGroup/ToggleGroupPrimitive.d.ts.map +1 -1
- package/dist/atomic/Tooltip/TooltipPrimitive.d.ts +1 -1
- package/dist/atomic/Tooltip/TooltipPrimitive.d.ts.map +1 -1
- package/dist/atomic/Tooltip/TooltipPrimitive.js +0 -1
- package/dist/atomic/Tooltip/index.d.ts +6 -12
- package/dist/atomic/Tooltip/index.d.ts.map +1 -1
- package/dist/atomic/Tooltip/index.js +13 -23
- package/dist/atomic/VideoPlayer/index.js +1 -1
- package/dist/atomic/VisuallyHidden/VisuallyHiddenPrimitive.d.ts.map +1 -1
- package/dist/atomic/index.d.ts +2 -3
- package/dist/atomic/index.d.ts.map +1 -1
- package/dist/atomic/index.js +1 -2
- package/dist/hooks/useToast.d.ts +1 -25
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/styles/index.css +627 -68
- package/dist/utils/variants.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/atomic/Combobox/ComboboxPrimitive.d.ts +0 -18
- package/dist/atomic/Combobox/ComboboxPrimitive.d.ts.map +0 -1
- package/dist/atomic/Combobox/ComboboxPrimitive.js +0 -14
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { useState, useId } from 'react';
|
|
12
12
|
import { cn } from '../../utils/helpers';
|
|
13
13
|
import Icon from '../Icons/Icon';
|
|
14
|
-
import
|
|
14
|
+
import { FloatingLabel } from '../Label';
|
|
15
15
|
import './Input.css';
|
|
16
16
|
/**
|
|
17
17
|
* Accessible input component with mobile-friendly touch targets.
|
|
@@ -31,36 +31,27 @@ import './Input.css';
|
|
|
31
31
|
* @param {InputProps} props - The props for the input
|
|
32
32
|
* @returns {JSX.Element} The rendered input
|
|
33
33
|
*/
|
|
34
|
-
const Input = ({ className, type, icon, iconEnd = false, label, value, onFocus, onBlur, ...props }) => {
|
|
34
|
+
const Input = ({ className, type, icon, iconEnd = false, label, value, onFocus, onBlur, required, ...props }) => {
|
|
35
35
|
const id = useId();
|
|
36
36
|
const hasIcon = !!icon;
|
|
37
37
|
const isLeading = !iconEnd;
|
|
38
38
|
const isTrailing = iconEnd;
|
|
39
39
|
const hasLabel = !!label;
|
|
40
40
|
const inputClasses = cn('dndev-input', hasIcon && isLeading && 'dndev-input-with-leading-icon', hasIcon && isTrailing && 'dndev-input-with-trailing-icon', className);
|
|
41
|
-
|
|
41
|
+
// Explicitly exclude children to prevent void element error (input is a void element)
|
|
42
|
+
const { children: _children, ...inputProps } = props;
|
|
43
|
+
const inputElement = (_jsx("input", { id: id, type: type, value: value, required: required, className: inputClasses, ...inputProps }));
|
|
42
44
|
const needsWrapper = hasIcon || hasLabel;
|
|
45
|
+
// Build input with optional icon wrapper
|
|
46
|
+
const inputWithIcon = hasIcon ? (_jsxs("div", { className: "dndev-relative", children: [inputElement, _jsx("div", { className: cn('dndev-input-icon', isLeading && 'dndev-input-icon-leading', isTrailing && 'dndev-input-icon-trailing'), children: _jsx(Icon, { icon: icon, className: "dndev-size-md", ariaHidden: true }) })] })) : (inputElement);
|
|
43
47
|
if (!needsWrapper) {
|
|
44
48
|
return inputElement;
|
|
45
49
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
color: props.disabled
|
|
53
|
-
? 'var(--muted-foreground)'
|
|
54
|
-
: 'var(--foreground)',
|
|
55
|
-
pointerEvents: 'none',
|
|
56
|
-
zIndex: 1,
|
|
57
|
-
backgroundColor: 'var(--background)',
|
|
58
|
-
padding: '0 var(--gap-xs)',
|
|
59
|
-
lineHeight: 1,
|
|
60
|
-
maxWidth: 'calc(100% - var(--gap-md) * 2)',
|
|
61
|
-
overflow: 'hidden',
|
|
62
|
-
textOverflow: 'ellipsis',
|
|
63
|
-
whiteSpace: 'nowrap',
|
|
64
|
-
}, children: label })), inputElement, hasIcon && (_jsx("div", { className: cn('dndev-input-icon', isLeading && 'dndev-input-icon-leading', isTrailing && 'dndev-input-icon-trailing'), children: _jsx(Icon, { icon: icon, className: "dndev-size-md", ariaHidden: true }) }))] }));
|
|
50
|
+
// With label: use FloatingLabel wrapper (fieldset/legend)
|
|
51
|
+
if (hasLabel) {
|
|
52
|
+
return (_jsx(FloatingLabel, { htmlFor: id, label: label, disabled: props.disabled, required: required, children: inputWithIcon }));
|
|
53
|
+
}
|
|
54
|
+
// Icon only, no label
|
|
55
|
+
return inputWithIcon;
|
|
65
56
|
};
|
|
66
57
|
export default Input;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview FloatingLabel component
|
|
3
|
+
* @description Fieldset/legend wrapper for native border-cutting floating labels.
|
|
4
|
+
* Uses semantic HTML - browser natively cuts border where legend sits.
|
|
5
|
+
* No background color hacks needed.
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.2
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
11
|
+
import './Label.css';
|
|
12
|
+
import type { ReactNode } from 'react';
|
|
13
|
+
export interface FloatingLabelProps {
|
|
14
|
+
/** HTML id to associate legend with input (for accessibility) */
|
|
15
|
+
htmlFor?: string;
|
|
16
|
+
/** Label text - REQUIRED */
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
/** Whether the input is disabled */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Whether to truncate long labels with ellipsis */
|
|
21
|
+
truncate?: boolean;
|
|
22
|
+
/** Whether the field is required - shows asterisk indicator */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** Children (the input element) - REQUIRED */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** Additional className for the fieldset */
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* FloatingLabel - Fieldset/legend wrapper for floating labels
|
|
31
|
+
*
|
|
32
|
+
* Uses semantic HTML to achieve the "label on border" effect without
|
|
33
|
+
* background color hacks. Works on any background color.
|
|
34
|
+
*
|
|
35
|
+
* @component
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <FloatingLabel label="Email Address" htmlFor="email" required>
|
|
39
|
+
* <input id="email" type="email" />
|
|
40
|
+
* </FloatingLabel>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function FloatingLabel({ htmlFor, label, disabled, truncate, required, children, className, }: FloatingLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export default FloatingLabel;
|
|
45
|
+
//# sourceMappingURL=FloatingLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingLabel.d.ts","sourceRoot":"","sources":["../../../src/atomic/Label/FloatingLabel.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,SAAS,CAAC;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,SAAS,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,KAAK,EACL,QAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,2CA6BpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/atomic/Label/FloatingLabel.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview FloatingLabel component
|
|
5
|
+
* @description Fieldset/legend wrapper for native border-cutting floating labels.
|
|
6
|
+
* Uses semantic HTML - browser natively cuts border where legend sits.
|
|
7
|
+
* No background color hacks needed.
|
|
8
|
+
*
|
|
9
|
+
* @version 0.0.2
|
|
10
|
+
* @since 0.0.1
|
|
11
|
+
* @author AMBROISE PARK Consulting
|
|
12
|
+
*/
|
|
13
|
+
import './Label.css';
|
|
14
|
+
/**
|
|
15
|
+
* FloatingLabel - Fieldset/legend wrapper for floating labels
|
|
16
|
+
*
|
|
17
|
+
* Uses semantic HTML to achieve the "label on border" effect without
|
|
18
|
+
* background color hacks. Works on any background color.
|
|
19
|
+
*
|
|
20
|
+
* @component
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <FloatingLabel label="Email Address" htmlFor="email" required>
|
|
24
|
+
* <input id="email" type="email" />
|
|
25
|
+
* </FloatingLabel>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function FloatingLabel({ htmlFor, label, disabled = false, truncate = false, required = false, children, className, }) {
|
|
29
|
+
return (_jsxs("fieldset", { className: `dndev-floating-fieldset ${className || ''}`, disabled: disabled, "data-disabled": disabled ? 'true' : undefined, children: [_jsx("legend", { className: "dndev-floating-legend", "data-truncate": truncate ? 'true' : undefined, children: _jsxs("label", { htmlFor: htmlFor, children: [label, required && (_jsx("span", { style: {
|
|
30
|
+
color: 'var(--destructive-foreground)',
|
|
31
|
+
marginInlineStart: 'var(--gap-tight)',
|
|
32
|
+
}, "aria-hidden": "true", children: "*" }))] }) }), children] }));
|
|
33
|
+
}
|
|
34
|
+
export default FloatingLabel;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
|
+
import { FloatingLabel, type FloatingLabelProps } from './FloatingLabel';
|
|
9
10
|
import { type LabelPrimitiveProps } from './LabelPrimitive';
|
|
10
11
|
import type { ComponentType, ReactNode } from 'react';
|
|
11
12
|
export interface LabelProps extends LabelPrimitiveProps {
|
|
@@ -24,6 +25,8 @@ export interface LabelProps extends LabelPrimitiveProps {
|
|
|
24
25
|
* @default false
|
|
25
26
|
*/
|
|
26
27
|
plain?: boolean;
|
|
28
|
+
/** Whether the field is required - shows asterisk indicator */
|
|
29
|
+
required?: boolean;
|
|
27
30
|
children?: ReactNode;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
@@ -38,6 +41,7 @@ export interface LabelProps extends LabelPrimitiveProps {
|
|
|
38
41
|
* @param {LabelProps} props - The props for the label
|
|
39
42
|
* @returns {JSX.Element} The rendered label
|
|
40
43
|
*/
|
|
41
|
-
declare const Label: ({ className, icon: Icon, iconEnd, plain, children, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare const Label: ({ className, icon: Icon, iconEnd, plain, required, children, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
45
|
export default Label;
|
|
46
|
+
export { FloatingLabel, type FloatingLabelProps };
|
|
43
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Label/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAuB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,8CAA8C;IAC9C,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,KAAK,GAAI
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Label/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAuB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,8CAA8C;IAC9C,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,KAAK,GAAI,yEAQZ,UAAU,4CAgCZ,CAAC;AAEF,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
|
+
import { FloatingLabel } from './FloatingLabel';
|
|
11
12
|
import LabelPrimitive, {} from './LabelPrimitive';
|
|
12
13
|
import { cn } from '../../utils/helpers';
|
|
13
14
|
/**
|
|
@@ -22,8 +23,13 @@ import { cn } from '../../utils/helpers';
|
|
|
22
23
|
* @param {LabelProps} props - The props for the label
|
|
23
24
|
* @returns {JSX.Element} The rendered label
|
|
24
25
|
*/
|
|
25
|
-
const Label = ({ className, icon: Icon, iconEnd = false, plain = false, children, ...props }) => {
|
|
26
|
+
const Label = ({ className, icon: Icon, iconEnd = false, plain = false, required = false, children, ...props }) => {
|
|
26
27
|
const iconElement = Icon ? (_jsx(Icon, { className: "dndev-label-icon", "data-position": iconEnd ? 'trailing' : 'leading' })) : null;
|
|
27
|
-
|
|
28
|
+
const requiredIndicator = required ? (_jsx("span", { style: {
|
|
29
|
+
color: 'var(--destructive-foreground)',
|
|
30
|
+
marginInlineStart: 'var(--gap-tight)',
|
|
31
|
+
}, "aria-hidden": "true", children: "*" })) : null;
|
|
32
|
+
return (_jsxs(LabelPrimitive, { className: cn('dndev-text-base dndev-label-base', className), "data-plain": plain ? 'true' : undefined, ...props, children: [!iconEnd && iconElement, children, requiredIndicator, iconEnd && iconElement] }));
|
|
28
33
|
};
|
|
29
34
|
export default Label;
|
|
35
|
+
export { FloatingLabel };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List component
|
|
3
|
+
* @description Simple list component for bullet points, numbered lists, and feature lists
|
|
4
|
+
*
|
|
5
|
+
* @version 0.0.1
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
* @author AMBROISE PARK Consulting
|
|
8
|
+
*/
|
|
1
9
|
import { GAP_VARIANT } from '../../styles/componentConstants';
|
|
2
10
|
import type { ReactNode, HTMLAttributes } from 'react';
|
|
3
11
|
import './List.css';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/List/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/List/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,OAAO,EAAE,SAAS,CAAC;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAC/C,gBAAgB,GAAG,gBAAgB,CACpC;IACC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC1C,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;IACxD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,GAAI,6DAQX,SAAS,4CAoDX,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAExE,eAAe,IAAI,CAAC"}
|
|
@@ -8,8 +8,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
|
-
import { cn } from '../../utils/helpers';
|
|
12
11
|
import { GAP_VARIANT } from '../../styles/componentConstants';
|
|
12
|
+
import { cn } from '../../utils/helpers';
|
|
13
13
|
import './List.css';
|
|
14
14
|
/**
|
|
15
15
|
* List component for bullet points, numbered lists, and feature lists.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
9
|
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
10
|
-
import {
|
|
10
|
+
import type { ComponentProps } from 'react';
|
|
11
11
|
interface NavigationMenuPrimitiveProps extends ComponentProps<typeof RadixNavigationMenu.Root> {
|
|
12
12
|
vertical?: boolean;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuPrimitive.d.ts","sourceRoot":"","sources":["../../../src/atomic/NavigationMenu/NavigationMenuPrimitive.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationMenuPrimitive.d.ts","sourceRoot":"","sources":["../../../src/atomic/NavigationMenu/NavigationMenuPrimitive.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAC;AAMvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,4BAA6B,SAAQ,cAAc,CAC3D,OAAO,mBAAmB,CAAC,IAAI,CAChC;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,uBAAuB,GAAI,6CAK9B,4BAA4B,4CAc9B,CAAC;AAEF,UAAU,gCAAiC,SAAQ,cAAc,CAC/D,OAAO,mBAAmB,CAAC,IAAI,CAChC;IACC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,2BAA2B,GAAI,mCAIlC,gCAAgC,4CAMlC,CAAC;AAEF,QAAA,MAAM,2BAA2B,uIAA2B,CAAC;AAE7D,QAAA,MAAM,mCAAmC,oFAAU,CAAC;AAEpD,QAAA,MAAM,8BAA8B,GAAI,mCAIrC,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,4CASpD,CAAC;AAEF,QAAA,MAAM,8BAA8B,GAAI,yBAGrC,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,4CAKpD,CAAC;AAEF,QAAA,MAAM,2BAA2B,2IAA2B,CAAC;AAE7D,QAAA,MAAM,+BAA+B,GAAI,yBAGtC,cAAc,CAAC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,4CAOrD,CAAC;AAEF,QAAA,MAAM,gCAAgC,GAAI,yBAGvC,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,4CAOtD,CAAC;AAEF,eAAe,uBAAuB,CAAC;AACvC,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,gCAAgC,EAChC,+BAA+B,GAChC,CAAC"}
|
|
@@ -11,7 +11,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
12
12
|
import { cva } from 'class-variance-authority';
|
|
13
13
|
import { ChevronDown } from 'lucide-react';
|
|
14
|
-
import {} from 'react';
|
|
15
14
|
import { cn } from '../../utils/helpers';
|
|
16
15
|
const NavigationMenuPrimitive = ({ className, children, vertical = false, ...props }) => {
|
|
17
16
|
const orientation = vertical ? 'vertical' : 'horizontal';
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
|
-
import type { ComponentProps, ComponentType, ReactNode } from 'react';
|
|
10
9
|
import NavigationMenuPrimitive from './NavigationMenuPrimitive';
|
|
11
10
|
import { DISPLAY } from '../../styles/componentConstants';
|
|
11
|
+
import type { ComponentProps, ComponentType, ReactNode } from 'react';
|
|
12
12
|
import './NavigationMenu.css';
|
|
13
13
|
interface NavigationMenuItem {
|
|
14
14
|
/** The display label for the item */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/NavigationMenu/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/NavigationMenu/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,uBAON,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAI1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,sBAAsB,CAAC;AAE9B,UAAU,kBAAkB;IAC1B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChC,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,gDAAgD;IAChD,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,UAAU,mBAAoB,SAAQ,IAAI,CACxC,cAAc,CAAC,OAAO,uBAAuB,CAAC,EAC9C,UAAU,CACX;IACC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,aAAa,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,cAAc,GAAI,4EAQrB,mBAAmB,4CAqOrB,CAAC;AAEF,eAAe,cAAc,CAAC;AAC9B,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/atomic/NavigationMenu/index.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview NavigationMenu component
|
|
5
|
+
* @description Props-based navigation menu component built on Radix UI primitives
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.3
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
2
11
|
import NavigationMenuPrimitive, { NavigationMenuListPrimitive, NavigationMenuItemPrimitive, NavigationMenuContentPrimitive, NavigationMenuTriggerPrimitive, NavigationMenuLinkPrimitive, NavigationMenuViewportPrimitive, } from './NavigationMenuPrimitive';
|
|
3
|
-
import { cn } from '../../utils/helpers';
|
|
4
12
|
import { DISPLAY } from '../../styles/componentConstants';
|
|
13
|
+
import { cn } from '../../utils/helpers';
|
|
5
14
|
import Tooltip from '../Tooltip';
|
|
6
15
|
import './NavigationMenu.css';
|
|
7
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Pagination/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Pagination/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,CACX;IACC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,UAAU,GAAI,sHAUjB,eAAe,4CAuGjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
|
2
2
|
import './PasswordInput.css';
|
|
3
3
|
export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
-
/** Whether to show the password toggle button */
|
|
5
|
-
showToggle?: boolean;
|
|
6
|
-
/** Custom toggle button content */
|
|
7
|
-
toggleButton?: ReactNode;
|
|
8
4
|
/** Whether the password is currently visible */
|
|
9
5
|
visible?: boolean;
|
|
10
6
|
/** Callback when visibility changes */
|
|
11
7
|
onVisibilityChange?: (visible: boolean) => void;
|
|
12
8
|
/** Label for floating label - always shown small at top-left when provided */
|
|
13
9
|
label?: string;
|
|
10
|
+
/** Whether the field is required - shows asterisk indicator */
|
|
11
|
+
required?: boolean;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* PasswordInput Component
|
|
17
15
|
*
|
|
18
16
|
* A password input field with show/hide toggle functionality.
|
|
19
17
|
* Features industry-standard UX patterns:
|
|
20
|
-
* - Eye icon toggle (show/hide password)
|
|
21
|
-
* - Keyboard accessibility (Enter to toggle)
|
|
18
|
+
* - Eye icon toggle (show/hide password) - ALWAYS at end, cannot be overridden
|
|
22
19
|
* - Smooth icon transitions
|
|
23
20
|
* - Mobile-friendly touch targets
|
|
24
21
|
* - Screen reader support
|
|
25
22
|
* - ARIA labels and descriptions
|
|
26
23
|
*
|
|
24
|
+
* Opinionated: Eye icon is ALWAYS positioned at end with inline styles.
|
|
25
|
+
* If you need different behavior, create your own component.
|
|
26
|
+
*
|
|
27
27
|
* @component
|
|
28
|
-
* @version 0.0.
|
|
28
|
+
* @version 0.0.2
|
|
29
29
|
* @since 0.0.1
|
|
30
30
|
* @author AMBROISE PARK Consulting
|
|
31
31
|
* @example
|
|
@@ -34,12 +34,11 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
|
|
|
34
34
|
* value={password}
|
|
35
35
|
* onChange={setPassword}
|
|
36
36
|
* placeholder="Enter password"
|
|
37
|
-
* showToggle={true}
|
|
38
37
|
* />
|
|
39
38
|
* ```
|
|
40
39
|
* @param {PasswordInputProps} props - The props for the password input
|
|
41
40
|
* @returns {JSX.Element} The rendered password input
|
|
42
41
|
*/
|
|
43
|
-
declare const PasswordInput: ({ className,
|
|
42
|
+
declare const PasswordInput: ({ className, visible: controlledVisible, onVisibilityChange, label, value, onFocus, onBlur, required, ...props }: PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
43
|
export default PasswordInput;
|
|
45
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PasswordInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PasswordInput/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAE7B,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP;IACC,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,aAAa,GAAI,kHAUpB,kBAAkB,4CAmEpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// packages/components/src/atomic/PasswordInput/index.tsx
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview PasswordInput component
|
|
@@ -9,25 +9,26 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
11
|
import { Eye, EyeOff } from 'lucide-react';
|
|
12
|
-
import { useState, useId
|
|
12
|
+
import { useState, useId } from 'react';
|
|
13
13
|
import { cn } from '../../utils/helpers';
|
|
14
|
-
import
|
|
15
|
-
import Label from '../Label';
|
|
14
|
+
import { FloatingLabel } from '../Label';
|
|
16
15
|
import './PasswordInput.css';
|
|
17
16
|
/**
|
|
18
17
|
* PasswordInput Component
|
|
19
18
|
*
|
|
20
19
|
* A password input field with show/hide toggle functionality.
|
|
21
20
|
* Features industry-standard UX patterns:
|
|
22
|
-
* - Eye icon toggle (show/hide password)
|
|
23
|
-
* - Keyboard accessibility (Enter to toggle)
|
|
21
|
+
* - Eye icon toggle (show/hide password) - ALWAYS at end, cannot be overridden
|
|
24
22
|
* - Smooth icon transitions
|
|
25
23
|
* - Mobile-friendly touch targets
|
|
26
24
|
* - Screen reader support
|
|
27
25
|
* - ARIA labels and descriptions
|
|
28
26
|
*
|
|
27
|
+
* Opinionated: Eye icon is ALWAYS positioned at end with inline styles.
|
|
28
|
+
* If you need different behavior, create your own component.
|
|
29
|
+
*
|
|
29
30
|
* @component
|
|
30
|
-
* @version 0.0.
|
|
31
|
+
* @version 0.0.2
|
|
31
32
|
* @since 0.0.1
|
|
32
33
|
* @author AMBROISE PARK Consulting
|
|
33
34
|
* @example
|
|
@@ -36,13 +37,12 @@ import './PasswordInput.css';
|
|
|
36
37
|
* value={password}
|
|
37
38
|
* onChange={setPassword}
|
|
38
39
|
* placeholder="Enter password"
|
|
39
|
-
* showToggle={true}
|
|
40
40
|
* />
|
|
41
41
|
* ```
|
|
42
42
|
* @param {PasswordInputProps} props - The props for the password input
|
|
43
43
|
* @returns {JSX.Element} The rendered password input
|
|
44
44
|
*/
|
|
45
|
-
const PasswordInput = ({ className,
|
|
45
|
+
const PasswordInput = ({ className, visible: controlledVisible, onVisibilityChange, label, value, onFocus, onBlur, required, ...props }) => {
|
|
46
46
|
const id = useId();
|
|
47
47
|
const [internalVisible, setInternalVisible] = useState(false);
|
|
48
48
|
// Use controlled or internal state
|
|
@@ -55,26 +55,10 @@ const PasswordInput = ({ className, showToggle = true, toggleButton, visible: co
|
|
|
55
55
|
}
|
|
56
56
|
onVisibilityChange?.(newVisible);
|
|
57
57
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
return (_jsxs("div", { className: "dndev-relative", children: [hasLabel && (_jsx(Label, { htmlFor: id, style: {
|
|
65
|
-
position: 'absolute',
|
|
66
|
-
left: 'var(--gap-md)',
|
|
67
|
-
top: 'calc(-1 * var(--font-size-xs) / 2 - 1px)',
|
|
68
|
-
fontSize: 'var(--font-size-xs)',
|
|
69
|
-
fontWeight: 500,
|
|
70
|
-
color: props.disabled
|
|
71
|
-
? 'var(--muted-foreground)'
|
|
72
|
-
: 'var(--foreground)',
|
|
73
|
-
pointerEvents: 'none',
|
|
74
|
-
zIndex: 1,
|
|
75
|
-
backgroundColor: 'var(--background)',
|
|
76
|
-
padding: '0 var(--gap-xs)',
|
|
77
|
-
lineHeight: 1,
|
|
78
|
-
}, children: label })), _jsx("input", { id: id, type: isVisible ? 'text' : 'password', value: value, className: cn('dndev-input', showToggle && 'dndev-password-input-with-toggle', className), onKeyDown: handleKeyDown, onFocus: onFocus, onBlur: onBlur, ...props }), showToggle && (_jsx(Button, { type: "button", variant: BUTTON_VARIANT.GHOST, className: "dndev-password-toggle-button", onClick: toggleVisibility, "aria-label": isVisible ? 'Hide password' : 'Show password', "aria-describedby": props['aria-describedby'], tabIndex: -1, children: toggleButton || (_jsx(_Fragment, { children: isVisible ? (_jsx(EyeOff, { className: "dndev-size-md dndev-password-toggle-icon" })) : (_jsx(Eye, { className: "dndev-size-md dndev-password-toggle-icon" })) })) }))] }));
|
|
58
|
+
const inputContent = (_jsxs("div", { className: "dndev-relative", children: [_jsx("input", { id: id, type: isVisible ? 'text' : 'password', value: value, className: cn('dndev-input', 'dndev-password-input-with-toggle', className), onFocus: onFocus, onBlur: onBlur, required: required, ...props }), _jsx("button", { type: "button", className: "dndev-password-toggle-button", onClick: toggleVisibility, "aria-label": isVisible ? 'Hide password' : 'Show password', "aria-describedby": props['aria-describedby'], tabIndex: -1, children: isVisible ? (_jsx(EyeOff, { className: "dndev-size-md dndev-password-toggle-icon" })) : (_jsx(Eye, { className: "dndev-size-md dndev-password-toggle-icon" })) })] }));
|
|
59
|
+
if (!hasLabel) {
|
|
60
|
+
return inputContent;
|
|
61
|
+
}
|
|
62
|
+
return (_jsx(FloatingLabel, { htmlFor: id, label: label, disabled: props.disabled, required: required, children: inputContent }));
|
|
79
63
|
};
|
|
80
64
|
export default PasswordInput;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Popover component
|
|
3
|
-
* @description Accessible popover component built on Radix UI primitives
|
|
4
|
-
*
|
|
5
|
-
* @version 0.0.1
|
|
6
|
-
* @since 0.0.1
|
|
7
|
-
* @author AMBROISE PARK Consulting
|
|
8
|
-
*/
|
|
9
1
|
import { type FloatingVariant } from '../../utils/constants';
|
|
10
2
|
/**
|
|
11
3
|
* Popover subcomponents for advanced usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Popover/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Popover/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG/E;;GAEG;AACH,QAAA,MAAM,WAAW,oEAAmB,CAAC;AACrC,QAAA,MAAM,uBAAuB,qJAAiB,CAAC;AAC/C,QAAA,MAAM,uBAAuB;oBAK1B,CAAA;qBAA6C,CAAC;6CALH,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;CAAmB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,2BAA2B;IAC3B,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,OAAO;wHAYV,YAAY;;;;wBAzDZ,CAAA;yBAA6C,CAAC;;CA2EhD,CAAC;wBAMwB,OAAO,OAAO,GAAG;IACzC,IAAI,EAAE,OAAO,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,uBAAuB,CAAC;IACxC,OAAO,EAAE,OAAO,uBAAuB,CAAC;CACzC;AAJD,wBAIE"}
|
|
@@ -8,9 +8,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
|
+
import PopoverPrimitive, { PopoverTrigger, PopoverContent, } from './PopoverPrimitive';
|
|
11
12
|
import { FLOATING_VARIANT } from '../../utils/constants';
|
|
12
13
|
import { cn, getVariantDataAttrs } from '../../utils/helpers';
|
|
13
|
-
import PopoverPrimitive, { PopoverTrigger, PopoverContent, } from './PopoverPrimitive';
|
|
14
14
|
/**
|
|
15
15
|
* Popover subcomponents for advanced usage
|
|
16
16
|
*/
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview PortalButton component
|
|
3
|
+
* @description Button component that renders in a portal (document.body) to avoid transform issues
|
|
4
|
+
*
|
|
5
|
+
* @version 0.0.1
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
* @author AMBROISE PARK Consulting
|
|
8
|
+
*/
|
|
1
9
|
import { type ButtonProps } from '../Button';
|
|
2
10
|
export interface PortalButtonProps extends ButtonProps {
|
|
3
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PortalButton/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PortalButton/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,WAAW,iBAAkB,SAAQ,WAAW;CAAG;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAM7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -8,8 +8,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
|
-
import Portal from '../Portal';
|
|
12
11
|
import Button, {} from '../Button';
|
|
12
|
+
import Portal from '../Portal';
|
|
13
13
|
/**
|
|
14
14
|
* PortalButton - Button component rendered in a portal
|
|
15
15
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
9
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
10
|
-
import {
|
|
10
|
+
import type { ComponentProps } from 'react';
|
|
11
11
|
export interface ProgressPrimitiveProps extends ComponentProps<typeof ProgressPrimitive.Root> {
|
|
12
12
|
/**
|
|
13
13
|
* Visual variant of the progress bar.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressPrimitive.d.ts","sourceRoot":"","sources":["../../../src/atomic/Progress/ProgressPrimitive.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressPrimitive.d.ts","sourceRoot":"","sources":["../../../src/atomic/Progress/ProgressPrimitive.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAC5D,OAAO,iBAAiB,CAAC,IAAI,CAC9B;IACC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;CACxE;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,0BAA0B,GAAI,yCAKjC,sBAAsB,4CAkBxB,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -9,7 +9,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
11
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
12
|
-
import {} from 'react';
|
|
13
12
|
import { cn, getVariantDataAttrs } from '../../utils/helpers';
|
|
14
13
|
/**
|
|
15
14
|
* Accessible progress bar component built on Radix UI Progress.
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Progress component
|
|
3
|
+
* @description Accessible progress component built on Radix UI primitives
|
|
4
|
+
*
|
|
5
|
+
* @version 0.0.1
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
* @author AMBROISE PARK Consulting
|
|
8
|
+
*/
|
|
1
9
|
import ProgressPrimitive, { type ProgressPrimitiveProps } from './ProgressPrimitive';
|
|
2
10
|
declare const Progress: ({ className, ...props }: ProgressPrimitiveProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
11
|
export default Progress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Progress/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Progress/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,iBAAiB,EAAE,EACxB,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAG7B,QAAA,MAAM,QAAQ,GAAI,yBAAyB,sBAAsB,4CAEhE,CAAC;AAEF,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,sBAAsB,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -8,8 +8,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
|
-
import { cn } from '../../utils/helpers';
|
|
12
11
|
import ProgressPrimitive, {} from './ProgressPrimitive';
|
|
12
|
+
import { cn } from '../../utils/helpers';
|
|
13
13
|
const Progress = ({ className, ...props }) => (_jsx(ProgressPrimitive, { className: cn('dndev-progress', className), ...props }));
|
|
14
14
|
export default Progress;
|
|
15
15
|
export { ProgressPrimitive };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview RadioGroup Component - Props-based API
|
|
3
|
-
* @description Accessible radio group component built on Radix UI primitives with semantic color variants.
|
|
4
|
-
* Provides props-based API for 90% use cases with items prop.
|
|
5
|
-
*
|
|
6
|
-
* @version 0.0.3
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
1
|
import { type RadioOption, type RadioGroupRootProps } from './RadioGroupPrimitive';
|
|
11
2
|
import { CONTROL_VARIANT, type ControlVariant } from '../../utils/constants';
|
|
12
3
|
import type { ReactNode } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/RadioGroup/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/RadioGroup/index.tsx"],"names":[],"mappings":"AAcA,OAA4B,EAI1B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,kBAAkB,CAAC;AAoB1B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC;IAC5E,6BAA6B;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,UAAU,GAAG,WAAW,CAAC;IACtE,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,UAAU,GAAI,6DAOjB,eAAe,4CAyBjB,CAAC;AAEF,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,cAAc,IAAI,iBAAiB,EAAE,CAAC"}
|