@infonomic/uikit 6.8.2 → 6.9.1
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/README.md +183 -19
- package/dist/components/accordion/accordion.js +5 -5
- package/dist/components/accordion/accordion.module.css +11 -1
- package/dist/components/accordion/accordion_module.css +3 -1
- package/dist/components/avatar/avatar.d.ts +8 -2
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +6 -7
- package/dist/components/avatar/avatar.module.css +9 -4
- package/dist/components/avatar/avatar_module.css +3 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.module.css +9 -4
- package/dist/components/badge/badge_module.css +3 -1
- package/dist/components/button/button-group.d.ts +1 -1
- package/dist/components/button/button-group.module.css +11 -1
- package/dist/components/button/button-group_module.css +4 -2
- package/dist/components/button/button.module.css +9 -4
- package/dist/components/button/button_module.css +3 -1
- package/dist/components/button/combo-button.d.ts +1 -1
- package/dist/components/button/combo-button.module.css +11 -1
- package/dist/components/button/combo-button_module.css +3 -1
- package/dist/components/button/control-buttons.module.css +11 -1
- package/dist/components/button/control-buttons_module.css +3 -1
- package/dist/components/button/copy-button.module.css +9 -4
- package/dist/components/button/copy-button_module.css +3 -1
- package/dist/components/button/index.d.ts +5 -5
- package/dist/components/card/card.module.css +9 -4
- package/dist/components/card/card_module.css +3 -1
- package/dist/components/chips/chip.module.css +9 -4
- package/dist/components/chips/chip_module.css +3 -1
- package/dist/components/container/container.module.css +9 -4
- package/dist/components/container/container_module.css +6 -4
- package/dist/components/dropdown/dropdown.js +11 -11
- package/dist/components/dropdown/dropdown.module.css +9 -4
- package/dist/components/dropdown/dropdown_module.css +3 -1
- package/dist/components/hamburger/hamburger.module.css +9 -4
- package/dist/components/hamburger/hamburger_module.css +3 -1
- package/dist/components/inputs/autocomplete.module.css +9 -4
- package/dist/components/inputs/autocomplete_module.css +3 -1
- package/dist/components/inputs/calendar.module.css +9 -4
- package/dist/components/inputs/calendar_module.css +4 -2
- package/dist/components/inputs/checkbox-group.module.css +9 -4
- package/dist/components/inputs/checkbox-group_module.css +3 -1
- package/dist/components/inputs/checkbox.module.css +9 -4
- package/dist/components/inputs/checkbox_module.css +3 -1
- package/dist/components/inputs/error-text.module.css +9 -4
- package/dist/components/inputs/error-text_module.css +3 -1
- package/dist/components/inputs/help-text.module.css +9 -4
- package/dist/components/inputs/help-text_module.css +3 -1
- package/dist/components/inputs/input-adornment.module.css +9 -4
- package/dist/components/inputs/input-adornment_module.css +3 -1
- package/dist/components/inputs/input-password.d.ts +18 -2
- package/dist/components/inputs/input-password.d.ts.map +1 -1
- package/dist/components/inputs/input-password.js +19 -11
- package/dist/components/inputs/input-password.module.css +55 -0
- package/dist/components/inputs/input-password.module.js +5 -0
- package/dist/components/inputs/input-password_module.css +25 -0
- package/dist/components/inputs/input.d.ts +1 -1
- package/dist/components/inputs/input.module.css +9 -4
- package/dist/components/inputs/input_module.css +3 -1
- package/dist/components/inputs/label.module.css +9 -4
- package/dist/components/inputs/label_module.css +3 -1
- package/dist/components/inputs/radio-group.d.ts +1 -1
- package/dist/components/inputs/radio-group.module.css +9 -4
- package/dist/components/inputs/radio-group_module.css +3 -1
- package/dist/components/inputs/select.module.css +9 -4
- package/dist/components/inputs/select_module.css +3 -1
- package/dist/components/inputs/text-area.module.css +9 -4
- package/dist/components/inputs/text-area_module.css +3 -1
- package/dist/components/notifications/alert.module.css +9 -4
- package/dist/components/notifications/alert_module.css +4 -2
- package/dist/components/notifications/toast.module.css +9 -4
- package/dist/components/notifications/toast_module.css +5 -3
- package/dist/components/pager/first-button.d.ts +1 -1
- package/dist/components/pager/hooks/usePagination.d.ts +1 -1
- package/dist/components/pager/last-button.d.ts +1 -1
- package/dist/components/pager/next-button.d.ts +1 -1
- package/dist/components/pager/number-button.d.ts +1 -1
- package/dist/components/pager/pagination.d.ts +7 -7
- package/dist/components/pager/pagination.module.css +9 -4
- package/dist/components/pager/pagination_module.css +4 -2
- package/dist/components/pager/previous-button.d.ts +1 -1
- package/dist/components/scroll-area/scroll-area.module.css +9 -4
- package/dist/components/scroll-area/scroll-area_module.css +3 -1
- package/dist/components/scroll-to-top/scroll-to-top.module.css +9 -3
- package/dist/components/scroll-to-top/scroll-to-top_module.css +4 -2
- package/dist/components/section/section.module.css +9 -4
- package/dist/components/section/section_module.css +3 -1
- package/dist/components/shimmer/shimmer.module.css +9 -4
- package/dist/components/shimmer/shimmer_module.css +3 -1
- package/dist/components/table/table.module.css +9 -4
- package/dist/components/table/table_module.css +3 -1
- package/dist/components/tabs/tabs.module.css +9 -4
- package/dist/components/tabs/tabs_module.css +3 -1
- package/dist/components/tooltip/tooltip.module.css +9 -4
- package/dist/components/tooltip/tooltip_module.css +3 -1
- package/dist/css-layers.d.ts +23 -0
- package/dist/css-layers.d.ts.map +1 -0
- package/dist/css-layers.js +14 -0
- package/dist/icons/icons.module.css +11 -1
- package/dist/icons/icons_module.css +3 -1
- package/dist/icons/stopwatch-icon.d.ts +1 -1
- package/dist/loaders/ellipses.module.css +9 -4
- package/dist/loaders/ellipses_module.css +3 -1
- package/dist/loaders/ring.module.css +9 -4
- package/dist/loaders/ring_module.css +3 -1
- package/dist/loaders/spinner.module.css +9 -4
- package/dist/loaders/spinner_module.css +3 -1
- package/dist/react.d.ts +14 -14
- package/dist/styles/components-vanilla.css +1 -1
- package/dist/styles/reset.css +1 -1
- package/dist/styles/styles.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts +42 -1
- package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
- package/dist/widgets/datepicker/datepicker.js +34 -4
- package/dist/widgets/datepicker/datepicker.module.css +21 -2
- package/dist/widgets/datepicker/datepicker.module.js +1 -0
- package/dist/widgets/datepicker/datepicker_module.css +7 -2
- package/dist/widgets/drawer/drawer.d.ts +4 -4
- package/dist/widgets/drawer/drawer.module.css +11 -1
- package/dist/widgets/drawer/drawer_module.css +4 -2
- package/dist/widgets/modal/modal-context.d.ts +20 -0
- package/dist/widgets/modal/modal-context.d.ts.map +1 -0
- package/dist/widgets/modal/modal-context.js +4 -0
- package/dist/widgets/modal/modal-header.d.ts +1 -1
- package/dist/widgets/modal/modal-header.d.ts.map +1 -1
- package/dist/widgets/modal/modal-header.js +23 -1
- package/dist/widgets/modal/modal.d.ts +13 -8
- package/dist/widgets/modal/modal.d.ts.map +1 -1
- package/dist/widgets/modal/modal.js +8 -4
- package/dist/widgets/modal/modal.module.css +11 -1
- package/dist/widgets/modal/modal_module.css +5 -3
- package/dist/widgets/timeline/timeline.module.css +9 -4
- package/dist/widgets/timeline/timeline_module.css +3 -1
- package/package.json +45 -32
- package/src/components/accordion/accordion.module.css +11 -1
- package/src/components/avatar/avatar.module.css +9 -4
- package/src/components/avatar/avatar.stories.tsx +8 -0
- package/src/components/avatar/avatar.tsx +17 -8
- package/src/components/badge/badge.module.css +9 -4
- package/src/components/button/button-group.module.css +11 -1
- package/src/components/button/button.module.css +9 -4
- package/src/components/button/combo-button.module.css +11 -1
- package/src/components/button/control-buttons.module.css +11 -1
- package/src/components/button/copy-button.module.css +9 -4
- package/src/components/card/card.module.css +9 -4
- package/src/components/chips/chip.module.css +9 -4
- package/src/components/container/container.module.css +9 -4
- package/src/components/dropdown/dropdown.module.css +9 -4
- package/src/components/hamburger/hamburger.module.css +9 -4
- package/src/components/inputs/autocomplete.module.css +9 -4
- package/src/components/inputs/calendar.module.css +9 -4
- package/src/components/inputs/checkbox-group.module.css +9 -4
- package/src/components/inputs/checkbox.module.css +9 -4
- package/src/components/inputs/error-text.module.css +9 -4
- package/src/components/inputs/help-text.module.css +9 -4
- package/src/components/inputs/input-adornment.module.css +9 -4
- package/src/components/inputs/input-password.module.css +55 -0
- package/src/components/inputs/input-password.tsx +49 -7
- package/src/components/inputs/input.module.css +9 -4
- package/src/components/inputs/label.module.css +9 -4
- package/src/components/inputs/radio-group.module.css +9 -4
- package/src/components/inputs/select.module.css +9 -4
- package/src/components/inputs/text-area.module.css +9 -4
- package/src/components/notifications/alert.module.css +9 -4
- package/src/components/notifications/toast.module.css +9 -4
- package/src/components/pager/pagination.module.css +9 -4
- package/src/components/scroll-area/scroll-area.module.css +9 -4
- package/src/components/scroll-to-top/scroll-to-top.module.css +9 -3
- package/src/components/section/section.module.css +9 -4
- package/src/components/shimmer/shimmer.module.css +9 -4
- package/src/components/table/table.module.css +9 -4
- package/src/components/tabs/tabs.module.css +9 -4
- package/src/components/tooltip/tooltip.module.css +9 -4
- package/src/css-layers.ts +34 -0
- package/src/icons/icons.module.css +11 -1
- package/src/loaders/ellipses.module.css +9 -4
- package/src/loaders/ring.module.css +9 -4
- package/src/loaders/spinner.module.css +9 -4
- package/src/styles/base/animations.css +12 -0
- package/src/styles/base/base.css +12 -0
- package/src/styles/base/borders.css +12 -0
- package/src/styles/base/breakpoints.css +12 -0
- package/src/styles/base/colors.css +12 -0
- package/src/styles/base/opacity.css +12 -0
- package/src/styles/base/shadows.css +12 -0
- package/src/styles/base/size.css +12 -0
- package/src/styles/base/spacing.css +12 -0
- package/src/styles/base/transitions.css +12 -0
- package/src/styles/base/typography.css +12 -0
- package/src/styles/base/z-index.css +12 -0
- package/src/styles/components/components.css +12 -0
- package/src/styles/components/fade-in-lift.css +27 -13
- package/src/styles/components/hamburger.css +11 -6
- package/src/styles/components/loaders.css +168 -154
- package/src/styles/functional/README.md +18 -18
- package/src/styles/functional/borders.css +12 -0
- package/src/styles/functional/colors.css +12 -0
- package/src/styles/functional/functional.css +12 -0
- package/src/styles/functional/grid-flex.css +12 -0
- package/src/styles/functional/shadcn-compat.css +12 -0
- package/src/styles/functional/surfaces.css +12 -0
- package/src/styles/functional/typography.css +12 -0
- package/src/styles/local-fonts.css +12 -0
- package/src/styles/reset.css +18 -0
- package/src/styles/styles.css +9 -4
- package/src/styles/theme/autofill.css +12 -0
- package/src/styles/theme/defaults.css +12 -0
- package/src/styles/theme/scrollers.css +12 -0
- package/src/styles/theme/theme.css +12 -0
- package/src/styles/typography/fonts.css +12 -0
- package/src/styles/typography/prose.css +12 -0
- package/src/styles/typography.css +12 -0
- package/src/styles/utils/scroll-layout-shift.css +12 -0
- package/src/styles/utils/utility-classes.css +12 -0
- package/src/styles/utils/utils.css +12 -0
- package/src/widgets/datepicker/datepicker.module.css +21 -2
- package/src/widgets/datepicker/datepicker.tsx +97 -4
- package/src/widgets/drawer/drawer.module.css +11 -1
- package/src/widgets/modal/modal-context.ts +23 -0
- package/src/widgets/modal/modal-header.tsx +29 -2
- package/src/widgets/modal/modal.module.css +11 -1
- package/src/widgets/modal/modal.tsx +15 -6
- package/src/widgets/timeline/timeline.module.css +9 -4
|
@@ -4,6 +4,11 @@ import type { Meta } from '@storybook/react-vite'
|
|
|
4
4
|
|
|
5
5
|
import { Avatar as AvatarComponent } from './avatar.js'
|
|
6
6
|
|
|
7
|
+
// A local image, so the story makes no network request.
|
|
8
|
+
const photo = `data:image/svg+xml,${encodeURIComponent(
|
|
9
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7c9cbf"/><stop offset="1" stop-color="#2f4a6b"/></linearGradient></defs><rect width="40" height="40" fill="url(#g)"/><circle cx="20" cy="16" r="7" fill="#e8eef5"/><path d="M6 40c2-9 8-13 14-13s12 4 14 13z" fill="#e8eef5"/></svg>'
|
|
10
|
+
)}`
|
|
11
|
+
|
|
7
12
|
const meta: Meta = {
|
|
8
13
|
/* 👇 The title prop is optional.
|
|
9
14
|
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
@@ -35,5 +40,8 @@ export const Avatar = (): React.JSX.Element => (
|
|
|
35
40
|
<div style={{ height: '40px', width: '40px' }}>
|
|
36
41
|
<AvatarComponent initials="AB" />
|
|
37
42
|
</div>
|
|
43
|
+
<div style={{ height: '40px', width: '40px' }}>
|
|
44
|
+
<AvatarComponent initials="AB" src={photo} alt="Example user" />
|
|
45
|
+
</div>
|
|
38
46
|
</div>
|
|
39
47
|
)
|
|
@@ -7,19 +7,28 @@ import cx from 'clsx'
|
|
|
7
7
|
|
|
8
8
|
import styles from './avatar.module.css'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export interface AvatarProps {
|
|
11
|
+
/** Shown when there is no `src`, or while the image loads or if it fails. */
|
|
12
|
+
initials: string
|
|
13
|
+
/** Image URL. When omitted, no request is made and the initials show at once. */
|
|
14
|
+
src?: string
|
|
15
|
+
/** Text alternative for the image. Defaults to `initials`. */
|
|
16
|
+
alt?: string
|
|
17
|
+
}
|
|
11
18
|
|
|
12
|
-
export const Avatar = ({ initials
|
|
19
|
+
export const Avatar = ({ initials, src, alt = initials }: AvatarProps): React.JSX.Element => {
|
|
13
20
|
return (
|
|
14
21
|
<AvatarPrimitive.Root className={cx('infonomic-avatar-root', styles['avatar-root'])}>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
{src ? (
|
|
23
|
+
<AvatarPrimitive.Image
|
|
24
|
+
src={src}
|
|
25
|
+
alt={alt}
|
|
26
|
+
className={cx('infonomic-avatar-image', styles['avatar-image'])}
|
|
27
|
+
/>
|
|
28
|
+
) : null}
|
|
20
29
|
<AvatarPrimitive.Fallback
|
|
21
30
|
className={cx('infonomic-avatar-fallback', styles['avatar-fallback'])}
|
|
22
|
-
delay={600}
|
|
31
|
+
delay={src ? 600 : 0}
|
|
23
32
|
>
|
|
24
33
|
<span className={cx('infonomic-avatar-text', styles['avatar-text'])}>{initials}</span>
|
|
25
34
|
</AvatarPrimitive.Fallback>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.badge,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
@layer
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
6
|
+
infonomic-typography,
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
2
12
|
|
|
3
13
|
@layer infonomic-components {
|
|
4
14
|
.button-group,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.button,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
@layer
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
6
|
+
infonomic-typography,
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
2
12
|
|
|
3
13
|
@layer infonomic-components {
|
|
4
14
|
.combo-button-wrapper,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
@layer
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
6
|
+
infonomic-typography,
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
2
12
|
|
|
3
13
|
@layer infonomic-components {
|
|
4
14
|
.stop-button,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.copy-button-container,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.card,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.chip,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.container,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.dropdown-content,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.hamburger,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
/* ── Wrapper ── */
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.day-picker {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
:global(.infonomic-checkbox-group),
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.container,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.text,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.text,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.adornment,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
6
|
+
infonomic-typography,
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* InputPassword — the reveal toggle inside the input's end adornment.
|
|
15
|
+
*
|
|
16
|
+
* Override handle:
|
|
17
|
+
* .infonomic-input-password-toggle — the reveal/hide button
|
|
18
|
+
*
|
|
19
|
+
* It is a `<button>` so it is keyboard reachable and announced, which
|
|
20
|
+
* means the browser's default button chrome has to be stripped back to
|
|
21
|
+
* what the bare icon used to look like.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@layer infonomic-components {
|
|
25
|
+
.toggle,
|
|
26
|
+
:global(.infonomic-input-password-toggle) {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
padding: 0;
|
|
31
|
+
border: none;
|
|
32
|
+
background: none;
|
|
33
|
+
color: inherit;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
/* The icon is 18px; the box is padded out to a comfortable target
|
|
36
|
+
without changing where the icon sits. */
|
|
37
|
+
min-width: 1.375rem;
|
|
38
|
+
min-height: 1.375rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* A hairline ring at reduced opacity. The control is a 22px box sitting
|
|
43
|
+
* inside a 36px field, so a 2px ring at full `--ring-primary` reads as
|
|
44
|
+
* heavier than the input's own border and draws the eye away from the
|
|
45
|
+
* field. Thickness and offset are both 1px, which keeps the outer edge
|
|
46
|
+
* tight without touching the button box — so the 18px icon and the
|
|
47
|
+
* click target are unaffected.
|
|
48
|
+
*/
|
|
49
|
+
.toggle:focus-visible,
|
|
50
|
+
:global(.infonomic-input-password-toggle):focus-visible {
|
|
51
|
+
outline: 1px solid oklch(from var(--field-ring, var(--blue-500)) l c h / 0.6);
|
|
52
|
+
outline-offset: 1px;
|
|
53
|
+
border-radius: var(--border-radius-sm, 3px);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,24 +1,66 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
|
|
3
|
+
import cx from 'clsx'
|
|
4
|
+
|
|
3
5
|
import { EyeClosedIcon } from '../../icons/eye-closed-icon.jsx'
|
|
4
6
|
import { EyeOpenIcon } from '../../icons/eye-open-icon.jsx'
|
|
5
7
|
import { Input } from './input.jsx'
|
|
8
|
+
import styles from './input-password.module.css'
|
|
6
9
|
import type { InputProps } from './input.jsx'
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* `type` and `endAdornment` are the two props this component exists to
|
|
13
|
+
* control, so they are removed from the public surface rather than left
|
|
14
|
+
* to be overridden.
|
|
15
|
+
*
|
|
16
|
+
* They used to be overridable by accident: props were spread AFTER them,
|
|
17
|
+
* so a caller passing the obvious `type="password"` silently defeated the
|
|
18
|
+
* toggle — the icon swapped, the field stayed masked. Omitting them turns
|
|
19
|
+
* that into a compile error instead of a bug someone has to notice.
|
|
20
|
+
*/
|
|
21
|
+
export interface InputPasswordProps extends Omit<InputProps, 'type' | 'endAdornment'> {
|
|
22
|
+
/** Accessible name for the reveal control while the password is hidden. */
|
|
23
|
+
showPasswordLabel?: string
|
|
24
|
+
/** Accessible name for the reveal control while the password is shown. */
|
|
25
|
+
hidePasswordLabel?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function InputPassword({
|
|
29
|
+
showPasswordLabel = 'Show password',
|
|
30
|
+
hidePasswordLabel = 'Hide password',
|
|
31
|
+
...props
|
|
32
|
+
}: InputPasswordProps) {
|
|
9
33
|
const [visible, setVisible] = useState(false)
|
|
10
34
|
|
|
11
35
|
return (
|
|
12
36
|
<Input
|
|
37
|
+
// Spread first: `type` below is the whole point of the component and
|
|
38
|
+
// must win over anything a caller passes.
|
|
39
|
+
{...props}
|
|
13
40
|
type={visible ? 'text' : 'password'}
|
|
14
41
|
endAdornment={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
className={cx('infonomic-input-password-toggle', styles.toggle)}
|
|
45
|
+
// A real button, not a div: the control has to be reachable by
|
|
46
|
+
// keyboard and announced by a screen reader. The icons are
|
|
47
|
+
// `aria-hidden`, so without a name here the control is silent.
|
|
48
|
+
aria-label={visible ? hidePasswordLabel : showPasswordLabel}
|
|
49
|
+
aria-pressed={visible}
|
|
50
|
+
// Clicking the toggle must not blur the field. Beyond keeping the
|
|
51
|
+
// caret where the user left it, a blur fires the form's validation
|
|
52
|
+
// and the re-render that follows can replace this element between
|
|
53
|
+
// mousedown and mouseup — which loses the click entirely.
|
|
54
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
55
|
+
onClick={() => setVisible((current) => !current)}
|
|
56
|
+
>
|
|
57
|
+
{visible ? (
|
|
58
|
+
<EyeOpenIcon width="18px" height="18px" />
|
|
59
|
+
) : (
|
|
60
|
+
<EyeClosedIcon width="18px" height="18px" />
|
|
61
|
+
)}
|
|
62
|
+
</button>
|
|
20
63
|
}
|
|
21
|
-
{...props}
|
|
22
64
|
/>
|
|
23
65
|
)
|
|
24
66
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.input-wrapper,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.label,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
/* 'border-collapse w-full text-sm text-left text-gray-700 dark:text-gray-400 m-0', */
|
|
9
14
|
@layer infonomic-components {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.positioner,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.text-area,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
@layer
|
|
2
|
-
infonomic-
|
|
3
|
-
|
|
1
|
+
@layer base,
|
|
2
|
+
infonomic-base,
|
|
3
|
+
theme,
|
|
4
4
|
infonomic-theme,
|
|
5
|
+
infonomic-functional,
|
|
5
6
|
infonomic-typography,
|
|
6
|
-
|
|
7
|
+
components,
|
|
8
|
+
infonomic-components,
|
|
9
|
+
overrides,
|
|
10
|
+
infonomic-utilities,
|
|
11
|
+
utilities;
|
|
7
12
|
|
|
8
13
|
@layer infonomic-components {
|
|
9
14
|
.alert,
|