@konce-pt/react 0.12.0 → 0.15.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/README.md +122 -64
- package/dist/accordion/accordion.d.ts +14 -6
- package/dist/accordion/accordion.js +14 -7
- package/dist/accordion/llms.txt +22 -10
- package/dist/alert/alert.d.ts +2 -2
- package/dist/alert/alert.js +2 -2
- package/dist/alert/llms.txt +10 -10
- package/dist/app-shell/app-shell.d.ts +14 -14
- package/dist/app-shell/app-shell.js +11 -11
- package/dist/app-shell/llms.txt +13 -13
- package/dist/auth/auth-types.d.ts +6 -6
- package/dist/auth/auth.d.ts +2 -2
- package/dist/auth/auth.js +7 -7
- package/dist/auth/llms.txt +9 -9
- package/dist/autocomplete/autocomplete.d.ts +19 -6
- package/dist/autocomplete/autocomplete.js +23 -10
- package/dist/autocomplete/llms.txt +16 -5
- package/dist/avatar/avatar.d.ts +6 -6
- package/dist/avatar/avatar.js +5 -5
- package/dist/avatar/llms.txt +10 -10
- package/dist/avatar-group/avatar-group.d.ts +4 -4
- package/dist/avatar-group/avatar-group.js +3 -3
- package/dist/avatar-group/llms.txt +8 -8
- package/dist/backdrop/backdrop.d.ts +7 -7
- package/dist/backdrop/backdrop.js +16 -16
- package/dist/backdrop/llms.txt +27 -27
- package/dist/badge/badge.d.ts +3 -3
- package/dist/badge/badge.js +1 -1
- package/dist/badge/llms.txt +11 -11
- package/dist/bottom-sheet/bottom-sheet.d.ts +4 -4
- package/dist/bottom-sheet/bottom-sheet.js +2 -2
- package/dist/bottom-sheet/llms.txt +9 -9
- package/dist/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/breadcrumb/breadcrumb.js +3 -3
- package/dist/breadcrumb/llms.txt +3 -3
- package/dist/button/button.d.ts +3 -3
- package/dist/button/button.js +8 -8
- package/dist/button/llms.txt +27 -19
- package/dist/button-group/button-group.d.ts +9 -9
- package/dist/button-group/button-group.js +30 -8
- package/dist/button-group/llms.txt +20 -14
- package/dist/card/card.d.ts +8 -8
- package/dist/card/card.js +6 -6
- package/dist/card/llms.txt +20 -20
- package/dist/carousel/carousel.d.ts +6 -6
- package/dist/carousel/carousel.js +4 -4
- package/dist/carousel/llms.txt +10 -10
- package/dist/charts/chart-legend.d.ts +3 -3
- package/dist/charts/chart-legend.js +1 -1
- package/dist/charts/chart-tooltip.d.ts +3 -3
- package/dist/charts/chart-tooltip.js +1 -1
- package/dist/charts/chart.d.ts +1 -1
- package/dist/charts/chart.js +8 -8
- package/dist/charts/llms.txt +6 -6
- package/dist/charts-entry/public-api.js +2 -2
- package/dist/chat/chat.d.ts +17 -10
- package/dist/chat/chat.js +42 -18
- package/dist/chat/llms.txt +32 -17
- package/dist/chat-composer/chat-composer.d.ts +17 -7
- package/dist/chat-composer/chat-composer.js +21 -8
- package/dist/chat-composer/llms.txt +20 -11
- package/dist/chat-dock/chat-dock.d.ts +11 -4
- package/dist/chat-dock/chat-dock.js +9 -6
- package/dist/chat-dock/llms.txt +15 -14
- package/dist/chat-entry/public-api.js +1 -1
- package/dist/chat-message/chat-message.d.ts +12 -5
- package/dist/chat-message/chat-message.js +17 -7
- package/dist/chat-message/llms.txt +16 -15
- package/dist/chat-typing/chat-typing.d.ts +2 -2
- package/dist/chat-typing/chat-typing.js +3 -3
- package/dist/chat-typing/llms.txt +6 -6
- package/dist/checkbox/checkbox.d.ts +13 -6
- package/dist/checkbox/checkbox.js +26 -7
- package/dist/checkbox/llms.txt +24 -12
- package/dist/chip/chip.d.ts +4 -4
- package/dist/chip/chip.js +2 -2
- package/dist/chip/llms.txt +11 -11
- package/dist/chips-input/chips-input.d.ts +4 -4
- package/dist/chips-input/chips-input.js +35 -9
- package/dist/chips-input/llms.txt +15 -8
- package/dist/clock/clock.d.ts +4 -4
- package/dist/clock/clock.js +7 -7
- package/dist/clock/llms.txt +8 -8
- package/dist/color-picker/color-picker.d.ts +6 -6
- package/dist/color-picker/color-picker.js +3 -3
- package/dist/color-picker/llms.txt +5 -5
- package/dist/confirm/confirm-container.d.ts +3 -3
- package/dist/confirm/confirm-container.js +5 -5
- package/dist/confirm/confirm-store.d.ts +4 -4
- package/dist/confirm/confirm-store.js +7 -7
- package/dist/confirm/llms.txt +6 -6
- package/dist/context-menu/context-menu.d.ts +1 -1
- package/dist/context-menu/context-menu.js +5 -5
- package/dist/context-menu/llms.txt +7 -7
- package/dist/data-table/data-table-types.d.ts +5 -5
- package/dist/data-table/data-table.d.ts +29 -8
- package/dist/data-table/data-table.js +340 -95
- package/dist/data-table/export-csv.d.ts +3 -3
- package/dist/data-table/export-csv.js +4 -4
- package/dist/data-table/llms.txt +127 -94
- package/dist/data-view/data-view.d.ts +13 -5
- package/dist/data-view/data-view.js +67 -6
- package/dist/data-view/llms.txt +29 -10
- package/dist/date-range/date-range.d.ts +9 -9
- package/dist/date-range/date-range.js +24 -24
- package/dist/date-range/llms.txt +20 -20
- package/dist/datepicker/datepicker.d.ts +10 -10
- package/dist/datepicker/datepicker.js +29 -29
- package/dist/datepicker/llms.txt +24 -24
- package/dist/dialog/dialog.d.ts +12 -7
- package/dist/dialog/dialog.js +4 -4
- package/dist/dialog/llms.txt +14 -11
- package/dist/divider/divider.d.ts +1 -1
- package/dist/divider/llms.txt +4 -4
- package/dist/drawer/drawer.d.ts +5 -5
- package/dist/drawer/drawer.js +2 -2
- package/dist/drawer/llms.txt +11 -11
- package/dist/empty/empty.d.ts +2 -2
- package/dist/empty/empty.js +1 -1
- package/dist/empty/llms.txt +9 -9
- package/dist/fab/fab.d.ts +1 -1
- package/dist/fab/fab.js +1 -1
- package/dist/fab/llms.txt +10 -6
- package/dist/fieldset/fieldset.d.ts +18 -4
- package/dist/fieldset/fieldset.js +9 -6
- package/dist/fieldset/llms.txt +26 -9
- package/dist/file-upload/file-upload.d.ts +3 -3
- package/dist/file-upload/file-upload.js +7 -7
- package/dist/file-upload/llms.txt +7 -7
- package/dist/form-field/form-field-context.d.ts +4 -4
- package/dist/form-field/form-field.d.ts +12 -4
- package/dist/form-field/form-field.js +26 -6
- package/dist/form-field/llms.txt +25 -11
- package/dist/galleria/galleria.d.ts +3 -3
- package/dist/galleria/galleria.js +5 -5
- package/dist/galleria/llms.txt +7 -7
- package/dist/grid/col.d.ts +4 -4
- package/dist/grid/col.js +2 -2
- package/dist/grid/flex.d.ts +3 -3
- package/dist/grid/flex.js +1 -1
- package/dist/grid/grid.d.ts +7 -7
- package/dist/grid/grid.js +3 -3
- package/dist/grid/layout.d.ts +2 -2
- package/dist/grid/layout.js +2 -2
- package/dist/grid/llms.txt +15 -15
- package/dist/grid-entry/public-api.js +1 -1
- package/dist/i18n/i18n-context.d.ts +3 -3
- package/dist/i18n/i18n-context.js +7 -7
- package/dist/icon/icon-registry.d.ts +3 -3
- package/dist/icon/icon-registry.js +3 -3
- package/dist/icon/icon.d.ts +4 -4
- package/dist/icon/icon.js +6 -6
- package/dist/icon/llms.txt +13 -13
- package/dist/icon-button/icon-button.d.ts +2 -2
- package/dist/icon-button/icon-button.js +1 -1
- package/dist/icon-button/llms.txt +9 -5
- package/dist/icons-entry/public-api.d.ts +2 -2
- package/dist/icons-entry/public-api.js +3 -3
- package/dist/image/image.js +1 -1
- package/dist/image/llms.txt +13 -13
- package/dist/input/input.d.ts +18 -5
- package/dist/input/input.js +21 -6
- package/dist/input/llms.txt +25 -11
- package/dist/input-mask/input-mask.d.ts +1 -1
- package/dist/input-mask/input-mask.js +2 -2
- package/dist/input-mask/llms.txt +5 -5
- package/dist/input-number/input-number.d.ts +9 -9
- package/dist/input-number/input-number.js +11 -11
- package/dist/input-number/llms.txt +14 -14
- package/dist/input-otp/input-otp.d.ts +6 -6
- package/dist/input-otp/input-otp.js +10 -10
- package/dist/input-otp/llms.txt +9 -9
- package/dist/internal/calendar-focus.d.ts +1 -1
- package/dist/internal/calendar-focus.js +3 -3
- package/dist/internal/cn.d.ts +1 -1
- package/dist/internal/mask.d.ts +2 -2
- package/dist/internal/mask.js +4 -4
- package/dist/internal/option-key.d.ts +2 -2
- package/dist/internal/option-key.js +2 -2
- package/dist/internal/option-nav.d.ts +4 -4
- package/dist/internal/option-nav.js +5 -5
- package/dist/internal/overlay-container.js +1 -1
- package/dist/internal/overlay.d.ts +3 -3
- package/dist/internal/overlay.js +8 -8
- package/dist/internal/password-strength.d.ts +2 -2
- package/dist/internal/password-strength.js +6 -6
- package/dist/internal/roving.d.ts +2 -2
- package/dist/internal/roving.js +3 -3
- package/dist/internal/scroll-lock.d.ts +1 -1
- package/dist/internal/scroll-lock.js +2 -2
- package/dist/internal/slot-children.d.ts +3 -3
- package/dist/internal/slot-children.js +4 -4
- package/dist/internal/slot.d.ts +3 -3
- package/dist/internal/slot.js +2 -2
- package/dist/internal/step.d.ts +3 -3
- package/dist/internal/step.js +4 -4
- package/dist/internal/tween.d.ts +5 -5
- package/dist/internal/tween.js +5 -5
- package/dist/internal/types.d.ts +2 -2
- package/dist/internal/use-breakpoint.d.ts +2 -2
- package/dist/internal/use-breakpoint.js +4 -4
- package/dist/internal/use-controllable-state.d.ts +1 -1
- package/dist/internal/use-controllable-state.js +3 -3
- package/dist/internal/use-id.d.ts +2 -2
- package/dist/internal/use-id.js +2 -2
- package/dist/internal/use-modal-focus.d.ts +1 -1
- package/dist/internal/use-modal-focus.js +3 -3
- package/dist/knob/knob.d.ts +4 -4
- package/dist/knob/knob.js +14 -10
- package/dist/knob/llms.txt +17 -12
- package/dist/listbox/listbox.d.ts +6 -6
- package/dist/listbox/listbox.js +9 -9
- package/dist/listbox/llms.txt +10 -10
- package/dist/loader/llms.txt +56 -0
- package/dist/loader/loader.d.ts +49 -0
- package/dist/loader/loader.js +68 -0
- package/dist/map/llms.txt +25 -22
- package/dist/map/map-create-dialog.d.ts +4 -4
- package/dist/map/map-create-dialog.js +10 -10
- package/dist/map/map-hours-field.d.ts +4 -4
- package/dist/map/map-hours-field.js +7 -7
- package/dist/map/map-image-field.d.ts +2 -2
- package/dist/map/map-image-field.js +4 -4
- package/dist/map/map-legend.d.ts +4 -4
- package/dist/map/map-legend.js +2 -2
- package/dist/map/map-poi-card.d.ts +3 -3
- package/dist/map/map-poi-card.js +9 -9
- package/dist/map/map-search.d.ts +17 -6
- package/dist/map/map-search.js +21 -18
- package/dist/map/map.d.ts +21 -14
- package/dist/map/map.js +30 -29
- package/dist/map/ports.d.ts +9 -9
- package/dist/map/ports.js +6 -6
- package/dist/map-entry/public-api.js +2 -2
- package/dist/megamenu/llms.txt +9 -9
- package/dist/megamenu/megamenu.d.ts +6 -6
- package/dist/megamenu/megamenu.js +10 -10
- package/dist/mention/llms.txt +15 -15
- package/dist/mention/mention.d.ts +5 -5
- package/dist/mention/mention.js +2 -2
- package/dist/mention/mentions.d.ts +1 -1
- package/dist/mention/mentions.js +1 -1
- package/dist/menu/llms.txt +12 -12
- package/dist/menu/menu-item.d.ts +4 -4
- package/dist/menu/menu-keys.d.ts +2 -2
- package/dist/menu/menu-keys.js +5 -5
- package/dist/menu/menu.d.ts +2 -2
- package/dist/menu/menu.js +6 -6
- package/dist/menubar/llms.txt +10 -10
- package/dist/menubar/menubar.d.ts +5 -5
- package/dist/menubar/menubar.js +10 -10
- package/dist/meter-group/llms.txt +12 -12
- package/dist/meter-group/meter-group.d.ts +2 -2
- package/dist/meter-group/meter-group.js +1 -1
- package/dist/motion/motion-context.d.ts +22 -0
- package/dist/motion/motion-context.js +28 -0
- package/dist/order-list/llms.txt +22 -10
- package/dist/order-list/order-list.d.ts +12 -4
- package/dist/order-list/order-list.js +104 -21
- package/dist/paginator/llms.txt +8 -8
- package/dist/paginator/paginator.js +1 -1
- package/dist/panel/llms.txt +25 -13
- package/dist/panel/panel.d.ts +11 -3
- package/dist/panel/panel.js +7 -4
- package/dist/password/llms.txt +16 -8
- package/dist/password/password.d.ts +2 -2
- package/dist/password/password.js +24 -3
- package/dist/peek/llms.txt +10 -10
- package/dist/peek/peek.d.ts +6 -6
- package/dist/peek/peek.js +7 -7
- package/dist/pick-list/llms.txt +33 -13
- package/dist/pick-list/pick-list.d.ts +12 -4
- package/dist/pick-list/pick-list.js +111 -23
- package/dist/popover/llms.txt +11 -11
- package/dist/popover/popover.d.ts +4 -4
- package/dist/popover/popover.js +5 -5
- package/dist/progress/llms.txt +17 -17
- package/dist/progress/progress.d.ts +7 -7
- package/dist/progress/progress.js +6 -6
- package/dist/public-api.d.ts +15 -3
- package/dist/public-api.js +13 -7
- package/dist/radio-group/llms.txt +13 -6
- package/dist/radio-group/radio-group.d.ts +11 -4
- package/dist/radio-group/radio-group.js +15 -7
- package/dist/rating/llms.txt +20 -13
- package/dist/rating/rating-pointer.d.ts +16 -0
- package/dist/rating/rating-pointer.js +26 -0
- package/dist/rating/rating.d.ts +6 -6
- package/dist/rating/rating.js +76 -12
- package/dist/rich-text/lists.d.ts +2 -2
- package/dist/rich-text/lists.js +7 -7
- package/dist/rich-text/llms.txt +26 -17
- package/dist/rich-text/rich-text.d.ts +12 -7
- package/dist/rich-text/rich-text.js +78 -54
- package/dist/rich-text/sanitize.d.ts +3 -3
- package/dist/rich-text/sanitize.js +12 -12
- package/dist/rich-text/tables.d.ts +3 -3
- package/dist/rich-text/tables.js +3 -3
- package/dist/roadmap/llms.txt +15 -15
- package/dist/roadmap/roadmap.d.ts +6 -6
- package/dist/roadmap/roadmap.js +19 -19
- package/dist/roadmap-entry/public-api.js +2 -2
- package/dist/scroll-top/llms.txt +6 -6
- package/dist/scroll-top/scroll-top.d.ts +1 -1
- package/dist/scroll-top/scroll-top.js +1 -1
- package/dist/select/llms.txt +19 -12
- package/dist/select/select.d.ts +8 -8
- package/dist/select/select.js +47 -21
- package/dist/shared/types.d.ts +5 -5
- package/dist/shared/types.js +1 -1
- package/dist/sidenav/llms.txt +9 -9
- package/dist/sidenav/sidenav.d.ts +1 -1
- package/dist/sidenav/sidenav.js +1 -1
- package/dist/skeleton/llms.txt +3 -3
- package/dist/skeleton/skeleton.d.ts +1 -1
- package/dist/skeleton/skeleton.js +1 -1
- package/dist/slider/llms.txt +32 -13
- package/dist/slider/slider-drag.d.ts +26 -0
- package/dist/slider/slider-drag.js +79 -0
- package/dist/slider/slider.d.ts +6 -5
- package/dist/slider/slider.js +27 -8
- package/dist/speech/llms.txt +97 -0
- package/dist/speech/speech-button.d.ts +44 -0
- package/dist/speech/speech-button.js +86 -0
- package/dist/speech/speech-wave.d.ts +19 -0
- package/dist/speech/speech-wave.js +16 -0
- package/dist/speech/use-speech-recognition.d.ts +81 -0
- package/dist/speech/use-speech-recognition.js +179 -0
- package/dist/speed-dial/llms.txt +14 -8
- package/dist/speed-dial/speed-dial.d.ts +1 -1
- package/dist/speed-dial/speed-dial.js +1 -1
- package/dist/spinner/llms.txt +7 -7
- package/dist/spinner/spinner.d.ts +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/split-button/llms.txt +21 -15
- package/dist/split-button/split-button.d.ts +2 -2
- package/dist/split-button/split-button.js +4 -4
- package/dist/splitter/llms.txt +11 -11
- package/dist/splitter/splitter.d.ts +3 -3
- package/dist/splitter/splitter.js +5 -5
- package/dist/stepper/llms.txt +33 -14
- package/dist/stepper/stepper.d.ts +6 -6
- package/dist/stepper/stepper.js +53 -10
- package/dist/switch/llms.txt +12 -5
- package/dist/switch/switch.d.ts +10 -3
- package/dist/switch/switch.js +12 -5
- package/dist/switch-group/llms.txt +9 -9
- package/dist/switch-group/switch-group.d.ts +4 -4
- package/dist/switch-group/switch-group.js +4 -4
- package/dist/tabs/llms.txt +10 -10
- package/dist/tabs/tabs.d.ts +5 -5
- package/dist/tabs/tabs.js +8 -8
- package/dist/textarea/llms.txt +23 -12
- package/dist/textarea/textarea.d.ts +19 -6
- package/dist/textarea/textarea.js +21 -7
- package/dist/timeline/llms.txt +4 -4
- package/dist/timeline/timeline.d.ts +1 -1
- package/dist/timeline/timeline.js +1 -1
- package/dist/toast/llms.txt +47 -17
- package/dist/toast/toast-container.d.ts +9 -3
- package/dist/toast/toast-container.js +17 -9
- package/dist/toast/toast-store.d.ts +40 -4
- package/dist/toast/toast-store.js +36 -1
- package/dist/toolbar/llms.txt +7 -7
- package/dist/toolbar/toolbar.d.ts +3 -3
- package/dist/toolbar/toolbar.js +2 -2
- package/dist/tooltip/llms.txt +10 -10
- package/dist/tooltip/tooltip.d.ts +3 -3
- package/dist/tooltip/tooltip.js +18 -18
- package/dist/tree/llms.txt +25 -12
- package/dist/tree/tree-keys.d.ts +5 -5
- package/dist/tree/tree-keys.js +7 -7
- package/dist/tree/tree.d.ts +14 -7
- package/dist/tree/tree.js +53 -18
- package/dist/update/llms.txt +54 -0
- package/dist/update/update.d.ts +49 -0
- package/dist/update/update.js +82 -0
- package/package.json +15 -13
package/dist/datepicker/llms.txt
CHANGED
|
@@ -8,33 +8,33 @@ Import: `import { KptDatepicker } from '@konce-pt/react';`
|
|
|
8
8
|
<div class="kpt-datepicker" role="combobox" tabindex="0" aria-haspopup="dialog">
|
|
9
9
|
<span class="kpt-datepicker__value">06.09.2026</span>
|
|
10
10
|
<span class="kpt-datepicker__spacer"></span>
|
|
11
|
-
<button class="kpt-datepicker__clear"
|
|
12
|
-
<span class="kpt-icon-host kpt-datepicker__icon"
|
|
11
|
+
<button class="kpt-datepicker__clear">...</button>
|
|
12
|
+
<span class="kpt-icon-host kpt-datepicker__icon">...</span>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
<!-- in a portal: <div class="kpt-calendar"
|
|
15
|
+
<!-- in a portal: <div class="kpt-calendar">...</div> -->
|
|
16
16
|
|
|
17
17
|
## Props
|
|
18
|
-
- `value` / `defaultValue` / `onValueChange`
|
|
18
|
+
- `value` / `defaultValue` / `onValueChange` - the value as a string; its format follows the mode:
|
|
19
19
|
'YYYY-MM-DD' / 'YYYY-MM' / 'YYYY' / 'MM' / 'YYYY-MM-DDTHH:mm' / 'HH:mm'
|
|
20
20
|
- `selectionMode`: `'date'` (default) | `'monthYear'` | `'year'` | `'month'` | `'datetime'` | `'time'`
|
|
21
|
-
- `startView`: `'day' | 'month' | 'year' | 'decade' | null`
|
|
21
|
+
- `startView`: `'day' | 'month' | 'year' | 'decade' | null` - the level the panel opens at; `null`
|
|
22
22
|
means the level where the mode commits. It is never lowered below that level, so
|
|
23
23
|
`startView="day"` in 'year' mode is raised to 'year'.
|
|
24
24
|
- `minDate`, `maxDate`: 'YYYY-MM-DD' strings
|
|
25
25
|
- `monthDisplay`: `'long'` (default) | `'number'`; `displayFormat`: `'pl'` (default) | `'iso'` | `'locale'`
|
|
26
|
-
- `hourFormat`: 12 | 24 (default 24)
|
|
27
|
-
- `minuteStep`: number (default 1)
|
|
28
|
-
- `open` / `onOpenChange`
|
|
26
|
+
- `hourFormat`: 12 | 24 (default 24) - the dial; the stored value is always 24h
|
|
27
|
+
- `minuteStep`: number (default 1) - minute snapping on the dial
|
|
28
|
+
- `open` / `onOpenChange` - the panel state, so it can be opened from outside
|
|
29
29
|
- `placeholder`, `ariaLabel`, `disabled`, `invalid`, `touched`
|
|
30
|
-
- `onTouch()`
|
|
30
|
+
- `onTouch()` - fires when the panel closes or focus leaves the closed trigger
|
|
31
31
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
32
32
|
|
|
33
33
|
## Keyboard
|
|
34
34
|
The date picker dialog pattern. The trigger has `aria-haspopup="dialog"` and `aria-expanded`;
|
|
35
|
-
`Enter`, `Space` and
|
|
35
|
+
`Enter`, `Space` and `ArrowDown` open the panel - a `role="dialog"` named "Choose a date" - and move focus to
|
|
36
36
|
the selected day, or today, clamped to `minDate`/`maxDate`.
|
|
37
|
-
- Day grid:
|
|
37
|
+
- Day grid: `ArrowLeft`/`ArrowRight` one day, `ArrowUp`/`ArrowDown` one week, `Home`/`End` Monday and Sunday of the week,
|
|
38
38
|
`PageUp`/`PageDown` one month, with `Shift` one year (the day is clamped to the month length).
|
|
39
39
|
Crossing a month edge turns the page. Each day is named with the full date from `Intl`
|
|
40
40
|
("Thursday, October 8, 2026"), today has `aria-current="date"`, and only the focused day is
|
|
@@ -42,22 +42,22 @@ the selected day, or today, clamped to `minDate`/`maxDate`.
|
|
|
42
42
|
- Month, year and decade grids: the arrows move between cells (three columns), `Home`/`End` to the ends.
|
|
43
43
|
Clicking a title moves focus to the new grid.
|
|
44
44
|
- `Tab` cycles inside the panel; `Escape` closes it. Picking a value (or "Done") closes the panel
|
|
45
|
-
and returns focus to the trigger. `Delete`/`Backspace` on the trigger clears the value; the "
|
|
45
|
+
and returns focus to the trigger. `Delete`/`Backspace` on the trigger clears the value; the "x" button
|
|
46
46
|
sits outside the Tab order.
|
|
47
47
|
|
|
48
48
|
## The view stack
|
|
49
|
-
The header is always
|
|
49
|
+
The header is always `< title >`: the arrows page the current level, the title goes one level up.
|
|
50
50
|
|
|
51
|
-
day
|
|
52
|
-
month
|
|
53
|
-
year
|
|
54
|
-
decade
|
|
51
|
+
day < [June] [1979] > arrows +/-1 month; the chips -> months / years
|
|
52
|
+
month < [1979] > arrows +/-1 year; the chip -> years
|
|
53
|
+
year < [1970 - 1979] > arrows +/-10 years; the chip -> decades
|
|
54
|
+
decade < 1920 - 2039 > arrows +/-120 years; the top of the stack
|
|
55
55
|
|
|
56
56
|
Clicking a cell above the committing level drills down; on that level it sets the value and closes
|
|
57
57
|
the panel. An arrow dims when the whole neighbouring page falls outside `minDate`/`maxDate`.
|
|
58
58
|
|
|
59
59
|
## The logic lives in a package, the component only renders
|
|
60
|
-
Every grid, bound and format comes from `@konce-pt/datetime`
|
|
60
|
+
Every grid, bound and format comes from `@konce-pt/datetime` - pure functions with their own tests.
|
|
61
61
|
The component holds nothing but React state: the page, the level, the time buffer.
|
|
62
62
|
|
|
63
63
|
## The panel is set up on open, not on click
|
|
@@ -66,7 +66,7 @@ outside through the `open` prop. The effect deliberately depends on `open` alone
|
|
|
66
66
|
while the panel is open must not reset the view under the user's fingers.
|
|
67
67
|
|
|
68
68
|
## Requires
|
|
69
|
-
`@konce-pt/styles/components` for the calendar styles. No CDK
|
|
69
|
+
`@konce-pt/styles/components` for the calendar styles. No CDK - the panel rides the internal
|
|
70
70
|
overlay primitive.
|
|
71
71
|
|
|
72
72
|
## Examples
|
|
@@ -83,16 +83,16 @@ navigation labels and "Done" come from the `datepicker` and `common` namespaces;
|
|
|
83
83
|
|
|
84
84
|
## Week start, display format and field state
|
|
85
85
|
- The week starts by the active language (`Intl.Locale#getWeekInfo`, with a fallback list of regions):
|
|
86
|
-
en / en-US on Sunday, pl, de, en-GB on Monday. `firstDayOfWeek` (1 = Monday
|
|
86
|
+
en / en-US on Sunday, pl, de, en-GB on Monday. `firstDayOfWeek` (1 = Monday ... 7 = Sunday) overrides it;
|
|
87
87
|
the headers, the grid and `Home`/`End` follow it.
|
|
88
|
-
- `displayFormat`: `'pl'` (DD.MM.YYYY, default), `'iso'` (YYYY-MM-DD) or `'locale'`
|
|
88
|
+
- `displayFormat`: `'pl'` (DD.MM.YYYY, default), `'iso'` (YYYY-MM-DD) or `'locale'` - order and separators
|
|
89
89
|
from `Intl` (en-US: MM/DD/YYYY). The placeholder follows the format and its letters follow the language
|
|
90
90
|
(EN `YYYY`, PL `RRRR`, the `datepicker.yearToken`/`monthToken`/`dayToken` keys). AM/PM come from `Intl`.
|
|
91
91
|
- The field is `role="combobox"` with `aria-haspopup="dialog"` (the APG select-only combobox), so it carries
|
|
92
|
-
`aria-required` (`required`), `aria-readonly` (`readOnly`
|
|
92
|
+
`aria-required` (`required`), `aria-readonly` (`readOnly` - the value shows, the panel does not open,
|
|
93
93
|
there is no clear button) and `aria-invalid`.
|
|
94
|
-
- Turning the page with
|
|
95
|
-
"October, Choose month"
|
|
94
|
+
- Turning the page with < > is announced (`aria-live="polite"`); the title buttons are named
|
|
95
|
+
"October, Choose month" - the visible text first (WCAG 2.5.3). Clearing the value counts as a touch.
|
|
96
96
|
- "Today" is computed on every open, so a panel opened after midnight marks the right day.
|
|
97
97
|
|
|
98
98
|
## Label and description
|
package/dist/dialog/dialog.d.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
import { type KptI18nOverrides } from '../i18n/i18n-context.tsx';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Szerokość okna. `md` to wartość domyślna i zarazem jedyna, jaką okno miało wcześniej;
|
|
5
|
+
* `full` to cały ekran (bez ramki, zaokrągleń i marginesów).
|
|
6
|
+
*/
|
|
7
|
+
export type KptDialogSize = 'sm' | 'md' | 'lg' | 'full';
|
|
5
8
|
export interface KptDialogProps extends Omit<ComponentPropsWithRef<'dialog'>, 'open' | 'onClose'>, KptI18nOverrides {
|
|
6
9
|
open: boolean;
|
|
7
10
|
onOpenChange: (open: boolean) => void;
|
|
8
11
|
header?: string;
|
|
9
12
|
/**
|
|
10
|
-
* Szerokość okna: `sm` 24rem, `md` 32rem (domyślna), `lg` 48rem
|
|
13
|
+
* Szerokość okna: `sm` 24rem, `md` 32rem (domyślna), `lg` 48rem - zawsze przycięta do szerokości
|
|
11
14
|
* okna przeglądarki. `lg` jest dla treści, której nie da się sensownie zwęzić: kodu, tabeli,
|
|
12
|
-
* porównania dwóch kolumn.
|
|
15
|
+
* porównania dwóch kolumn. `full` zajmuje cały ekran, a treść rośnie na całą wysokość - dla
|
|
16
|
+
* podglądu kamery, edytora albo okna, które na telefonie ma być osobnym ekranem
|
|
17
|
+
* (`[size]="phone() ? 'full' : 'md'"`).
|
|
13
18
|
*/
|
|
14
19
|
size?: KptDialogSize;
|
|
15
|
-
/** Pozwala zamknąć klawiszem Esc i przyciskiem
|
|
20
|
+
/** Pozwala zamknąć klawiszem Esc i przyciskiem x. */
|
|
16
21
|
dismissible?: boolean;
|
|
17
22
|
children?: ReactNode;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
|
-
* Okno modalne na natywnym `<dialog>`
|
|
25
|
+
* Okno modalne na natywnym `<dialog>` - pułapka fokusu, Escape i backdrop pochodzą z platformy,
|
|
21
26
|
* nie z naszego kodu. Stopkę wstaw przez `<KptDialog.Footer>`.
|
|
22
27
|
*
|
|
23
28
|
* Z `header` okno bierze nazwę z nagłówka (`aria-labelledby`); bez niego podaj `aria-label`.
|
|
24
29
|
* Okno wymagające odpowiedzi dostaje `role="alertdialog"` i `aria-describedby` wprost z propsów
|
|
25
|
-
* `<dialog>`
|
|
30
|
+
* `<dialog>` - tak robi `KptConfirmContainer`.
|
|
26
31
|
*
|
|
27
32
|
* @example
|
|
28
33
|
* <KptDialog open={open} onOpenChange={setOpen} header="Usunąć?">
|
package/dist/dialog/dialog.js
CHANGED
|
@@ -10,12 +10,12 @@ import { KptOverlayContainerContext } from "../internal/overlay-container.js";
|
|
|
10
10
|
import { useKptMessages } from "../i18n/i18n-context.js";
|
|
11
11
|
import { KptIcon } from "../icon/icon.js";
|
|
12
12
|
/**
|
|
13
|
-
* Okno modalne na natywnym `<dialog>`
|
|
13
|
+
* Okno modalne na natywnym `<dialog>` - pułapka fokusu, Escape i backdrop pochodzą z platformy,
|
|
14
14
|
* nie z naszego kodu. Stopkę wstaw przez `<KptDialog.Footer>`.
|
|
15
15
|
*
|
|
16
16
|
* Z `header` okno bierze nazwę z nagłówka (`aria-labelledby`); bez niego podaj `aria-label`.
|
|
17
17
|
* Okno wymagające odpowiedzi dostaje `role="alertdialog"` i `aria-describedby` wprost z propsów
|
|
18
|
-
* `<dialog>`
|
|
18
|
+
* `<dialog>` - tak robi `KptConfirmContainer`.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* <KptDialog open={open} onOpenChange={setOpen} header="Usunąć?">
|
|
@@ -30,7 +30,7 @@ export function KptDialog({ open, onOpenChange, header = '', size = 'md', dismis
|
|
|
30
30
|
const { t } = useKptMessages({ locale, dictionary });
|
|
31
31
|
const dialogRef = useRef(null);
|
|
32
32
|
const titleId = useKptId(undefined, 'kpt-dialog-title');
|
|
33
|
-
// Element trafia do kontekstu, więc musi wywołać render
|
|
33
|
+
// Element trafia do kontekstu, więc musi wywołać render - sam `ref` by nie wystarczył.
|
|
34
34
|
const [dialogEl, setDialogEl] = useState(null);
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
const el = dialogRef.current;
|
|
@@ -49,7 +49,7 @@ export function KptDialog({ open, onOpenChange, header = '', size = 'md', dismis
|
|
|
49
49
|
/**
|
|
50
50
|
* `close` przychodzi z każdej drogi. Przy `dismissible=false` zamknąć wolno tylko z kodu:
|
|
51
51
|
* Chromium z CloseWatcherem pozwala anulować `cancel` jedynie po aktywacji użytkownika, więc drugi
|
|
52
|
-
* Escape z rzędu zamyka okno mimo `preventDefault`
|
|
52
|
+
* Escape z rzędu zamyka okno mimo `preventDefault` - wtedy otwieramy je z powrotem.
|
|
53
53
|
*/
|
|
54
54
|
const onClose = () => {
|
|
55
55
|
const el = dialogRef.current;
|
package/dist/dialog/llms.txt
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
# KptDialog (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
A modal window on a native `<dialog>`
|
|
3
|
+
A modal window on a native `<dialog>` - the focus trap, Escape and the backdrop come from the
|
|
4
4
|
platform, not from our code. Import: `import { KptDialog } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
7
7
|
<dialog class="kpt-dialog">
|
|
8
8
|
<div class="kpt-dialog__header">
|
|
9
9
|
<h2 class="kpt-dialog__title">Delete record?</h2>
|
|
10
|
-
<button class="kpt-dialog__close" type="button" aria-label="Close"
|
|
10
|
+
<button class="kpt-dialog__close" type="button" aria-label="Close">...</button>
|
|
11
11
|
</div>
|
|
12
|
-
<div class="kpt-dialog__body"
|
|
13
|
-
<div kptdialogfooter=""
|
|
12
|
+
<div class="kpt-dialog__body">...children...</div>
|
|
13
|
+
<div kptdialogfooter="">...footer...</div>
|
|
14
14
|
</dialog>
|
|
15
15
|
|
|
16
16
|
## Props
|
|
17
|
-
- `open`: boolean, `onOpenChange(open)`
|
|
17
|
+
- `open`: boolean, `onOpenChange(open)` - the dialog is always controlled; the browser can close it
|
|
18
18
|
on its own (Escape, the `close` event), and the state has to follow
|
|
19
|
-
- `header`: string
|
|
20
|
-
- `dismissible`: boolean (default true)
|
|
19
|
+
- `header`: string - the title; with no header there is no header row and no x button
|
|
20
|
+
- `dismissible`: boolean (default true) - allows Escape and shows x
|
|
21
|
+
- `size`: 'sm' | 'md' | 'lg' | 'full' (default 'md') - 24rem / 32rem / 48rem, capped at the viewport;
|
|
22
|
+
`full` covers the whole screen (no border, radius or margin) and the body grows to the full height -
|
|
23
|
+
e.g. `size={phone ? 'full' : 'md'}` for a window that is its own screen on a phone
|
|
21
24
|
- `className`, `ref` and every other `<dialog>` prop go to the dialog
|
|
22
25
|
|
|
23
26
|
## Sub-components
|
|
24
|
-
- `KptDialog.Footer`
|
|
27
|
+
- `KptDialog.Footer` - lifted below the body; carries the `kptdialogfooter` attribute the shared
|
|
25
28
|
SCSS targets.
|
|
26
29
|
|
|
27
30
|
## An overlay inside a modal
|
|
28
|
-
`showModal()` lifts the dialog into the browser's TOP LAYER, which sits above the whole document
|
|
31
|
+
`showModal()` lifts the dialog into the browser's TOP LAYER, which sits above the whole document -
|
|
29
32
|
no `z-index` beats it. A `KptSelect` or `KptMenu` panel portalled to `document.body` would open
|
|
30
33
|
INVISIBLE, hidden behind the modal backdrop. While it is open, `KptDialog` therefore makes itself
|
|
31
34
|
the overlay container (through `KptOverlayContainerContext`), so those panels portal INSIDE the
|
|
@@ -47,10 +50,10 @@ dialog; the mechanism differs, the result does not.
|
|
|
47
50
|
|
|
48
51
|
## Accessibility
|
|
49
52
|
A native `<dialog>` opened with `showModal()`: focus moves inside and is trapped, the rest of the
|
|
50
|
-
page becomes inert, and Escape closes it
|
|
53
|
+
page becomes inert, and Escape closes it - all from the browser. With `dismissible={false}` the
|
|
51
54
|
`cancel` event is prevented, so Escape stops working; give the user another way out.
|
|
52
55
|
With `header` the dialog is named by its title (`aria-labelledby`); without one pass `aria-label`.
|
|
53
56
|
`role="alertdialog"` and `aria-describedby` go straight through as `<dialog>` props.
|
|
54
57
|
|
|
55
58
|
## Scrolling and non-dismissible windows
|
|
56
|
-
An open window locks page scrolling underneath (a shared counter with drawers and bottom sheets, so nested windows do not release each other). With `dismissible` off the window gets `closedby="none"`, and if a browser still closes it on a gesture (Chromium lets the second Escape in a row through `cancel`), it is reopened
|
|
59
|
+
An open window locks page scrolling underneath (a shared counter with drawers and bottom sheets, so nested windows do not release each other). With `dismissible` off the window gets `closedby="none"`, and if a browser still closes it on a gesture (Chromium lets the second Escape in a row through `cancel`), it is reopened - only code can close it.
|
|
@@ -5,7 +5,7 @@ export interface KptDividerProps extends Omit<ComponentPropsWithRef<'div'>, 'chi
|
|
|
5
5
|
/** Wcięcie (odstęp od krawędzi kontenera). */
|
|
6
6
|
inset?: boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Linia czysto ozdobna (np. między kartami, które i tak są osobnymi regionami)
|
|
8
|
+
* Linia czysto ozdobna (np. między kartami, które i tak są osobnymi regionami) - bez
|
|
9
9
|
* `role="separator"`, ukryta przed czytnikiem. Domyślnie separator jest ogłaszany.
|
|
10
10
|
*/
|
|
11
11
|
decorative?: boolean;
|
package/dist/divider/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KptDivider (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
A separator
|
|
3
|
+
A separator - a horizontal or vertical line. Colour from `--kpt-color-border`.
|
|
4
4
|
Import: `import { KptDivider } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
@@ -8,13 +8,13 @@ Import: `import { KptDivider } from '@konce-pt/react';`
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
- `orientation`: 'horizontal' | 'vertical' (default 'horizontal')
|
|
11
|
-
- `inset`: boolean
|
|
12
|
-
- `decorative`: boolean
|
|
11
|
+
- `inset`: boolean - an indent from the container edges
|
|
12
|
+
- `decorative`: boolean - a purely ornamental line: no `role="separator"`, hidden from screen readers
|
|
13
13
|
- `className`, `ref` and every other `<div>` prop go to the divider
|
|
14
14
|
|
|
15
15
|
## Vertical needs a flex parent
|
|
16
16
|
The vertical variant stretches to the height of its container, so it only makes sense inside a
|
|
17
|
-
flex row
|
|
17
|
+
flex row - on its own it has nothing to measure against and collapses to nothing.
|
|
18
18
|
|
|
19
19
|
## Examples
|
|
20
20
|
<KptDivider />
|
package/dist/drawer/drawer.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ export interface KptDrawerProps extends Omit<ComponentPropsWithRef<'div'>, 'onCh
|
|
|
7
7
|
position?: KptDrawerPosition;
|
|
8
8
|
header?: string;
|
|
9
9
|
/**
|
|
10
|
-
* Nazwa panelu bez `header`
|
|
11
|
-
* dialogowe
|
|
10
|
+
* Nazwa panelu bez `header` - okno dialogowe bez nazwy czytnik ogłasza jako samo "okno
|
|
11
|
+
* dialogowe" (WCAG 4.1.2). Z nagłówkiem nazwą jest nagłówek (`aria-labelledby`).
|
|
12
12
|
*/
|
|
13
13
|
ariaLabel?: string;
|
|
14
|
-
/** Pokazuje przycisk
|
|
14
|
+
/** Pokazuje przycisk x i pozwala zamknąć klawiszem Escape. */
|
|
15
15
|
dismissible?: boolean;
|
|
16
16
|
closeOnBackdrop?: boolean;
|
|
17
17
|
children?: ReactNode;
|
|
@@ -19,12 +19,12 @@ export interface KptDrawerProps extends Omit<ComponentPropsWithRef<'div'>, 'onCh
|
|
|
19
19
|
/**
|
|
20
20
|
* Panel wysuwany (drawer / off-canvas), niezależny od app-shell.
|
|
21
21
|
*
|
|
22
|
-
* Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open`
|
|
22
|
+
* Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` - dzięki temu
|
|
23
23
|
* wysunięcie i schowanie da się animować, tak samo jak w porcie Angulara.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* <KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filtry">
|
|
27
|
-
* Treść panelu
|
|
27
|
+
* Treść panelu...
|
|
28
28
|
* </KptDrawer>
|
|
29
29
|
*/
|
|
30
30
|
export declare function KptDrawer({ open, onOpenChange, position, header, ariaLabel, dismissible, closeOnBackdrop, locale, dictionary, className, children, ...rest }: Readonly<KptDrawerProps>): import("react").JSX.Element;
|
package/dist/drawer/drawer.js
CHANGED
|
@@ -9,12 +9,12 @@ import { KptIcon } from "../icon/icon.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Panel wysuwany (drawer / off-canvas), niezależny od app-shell.
|
|
11
11
|
*
|
|
12
|
-
* Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open`
|
|
12
|
+
* Panel i backdrop są zawsze w DOM, a o widoczności decyduje klasa `is-open` - dzięki temu
|
|
13
13
|
* wysunięcie i schowanie da się animować, tak samo jak w porcie Angulara.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* <KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filtry">
|
|
17
|
-
* Treść panelu
|
|
17
|
+
* Treść panelu...
|
|
18
18
|
* </KptDrawer>
|
|
19
19
|
*/
|
|
20
20
|
export function KptDrawer({ open, onOpenChange, position = 'left', header = '', ariaLabel = '', dismissible = true, closeOnBackdrop = true, locale, dictionary, className, children, ...rest }) {
|
package/dist/drawer/llms.txt
CHANGED
|
@@ -9,38 +9,38 @@ Import: `import { KptDrawer } from '@konce-pt/react';`
|
|
|
9
9
|
<aside class="kpt-drawer__panel is-open" data-position="right" role="dialog" aria-modal="true" tabindex="-1">
|
|
10
10
|
<div class="kpt-drawer__header">
|
|
11
11
|
<span class="kpt-drawer__title">Filters</span>
|
|
12
|
-
<button class="kpt-drawer__close" type="button" aria-label="Close"
|
|
12
|
+
<button class="kpt-drawer__close" type="button" aria-label="Close">...</button>
|
|
13
13
|
</div>
|
|
14
|
-
<div class="kpt-drawer__body"
|
|
14
|
+
<div class="kpt-drawer__body">...children...</div>
|
|
15
15
|
</aside>
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
|
-
- `open`: boolean, `onOpenChange(open)`
|
|
19
|
+
- `open`: boolean, `onOpenChange(open)` - controlled
|
|
20
20
|
- `position`: 'left' | 'right' | 'top' | 'bottom' (default 'left')
|
|
21
21
|
- `header`: string
|
|
22
|
-
- `dismissible`: boolean (default true)
|
|
22
|
+
- `dismissible`: boolean (default true) - shows x and lets Escape close it
|
|
23
23
|
- `closeOnBackdrop`: boolean (default true)
|
|
24
24
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
25
25
|
|
|
26
26
|
## Always in the DOM
|
|
27
27
|
The panel and the backdrop are always rendered; only the `is-open` class decides what is visible.
|
|
28
|
-
That is what makes the slide animatable
|
|
28
|
+
That is what makes the slide animatable - mounting the panel on open would give the transition
|
|
29
29
|
nothing to animate from.
|
|
30
30
|
|
|
31
31
|
## Not a native modal
|
|
32
32
|
Unlike `KptDialog` this is a plain `<aside role="dialog" aria-modal="true">`, not a native
|
|
33
|
-
`<dialog>`
|
|
33
|
+
`<dialog>` - the focus handling below is done by the component, not by the browser.
|
|
34
34
|
|
|
35
35
|
## Focus and keyboard
|
|
36
36
|
Opening moves focus into the panel (its first focusable element, else the panel
|
|
37
|
-
itself) and traps it there
|
|
38
|
-
Closing returns focus to the element that had it before. `Escape` closes the panel
|
|
37
|
+
itself) and traps it there - `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises.
|
|
38
|
+
Closing returns focus to the element that had it before. `Escape` closes the panel - only when `dismissible`, like the `x` button. The panel
|
|
39
39
|
is named by its `header` through `aria-labelledby`. The shared helper is `internal/use-modal-focus.ts` (the Angular port has a twin on the CDK focus trap).
|
|
40
40
|
|
|
41
41
|
## Examples
|
|
42
42
|
<KptDrawer open={open} onOpenChange={setOpen} position="right" header="Filters">
|
|
43
|
-
Panel content
|
|
43
|
+
Panel content...
|
|
44
44
|
</KptDrawer>
|
|
45
45
|
|
|
46
46
|
## Tokens
|
|
@@ -49,7 +49,7 @@ is named by its `header` through `aria-labelledby`. The shared helper is `intern
|
|
|
49
49
|
|
|
50
50
|
## Accessibility
|
|
51
51
|
`role="dialog"`, `aria-modal="true"` and `aria-labelledby` pointing at the title; the close button gets
|
|
52
|
-
its label from `common.close`. Focus handling
|
|
52
|
+
its label from `common.close`. Focus handling - see "Focus and keyboard" above.
|
|
53
53
|
|
|
54
54
|
## Name and scrolling
|
|
55
|
-
Without `header` give the panel `ariaLabel`
|
|
55
|
+
Without `header` give the panel `ariaLabel` - a `role="dialog"` without a name is announced as a bare "dialog". An open drawer locks page scrolling underneath.
|
package/dist/empty/empty.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ export interface KptEmptyProps extends Omit<ComponentPropsWithRef<'div'>, 'title
|
|
|
6
6
|
description?: string;
|
|
7
7
|
/**
|
|
8
8
|
* Robi z tytułu nagłówek strony (`role="heading"` z `aria-level`), żeby pusty stan pojawił się
|
|
9
|
-
* w strukturze dokumentu
|
|
9
|
+
* w strukturze dokumentu - np. gdy zastępuje całą sekcję. Bez tego tytuł to sam tekst.
|
|
10
10
|
*/
|
|
11
11
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
12
|
/** Akcje pod opisem. */
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Stan pusty (empty state)
|
|
16
|
+
* Stan pusty (empty state) - ikona, tytuł, opis i opcjonalne akcje.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* <KptEmpty icon="search" title="Brak wyników" description="Zmień kryteria wyszukiwania.">
|
package/dist/empty/empty.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../internal/cn.js";
|
|
3
3
|
import { KptIcon } from "../icon/icon.js";
|
|
4
4
|
/**
|
|
5
|
-
* Stan pusty (empty state)
|
|
5
|
+
* Stan pusty (empty state) - ikona, tytuł, opis i opcjonalne akcje.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* <KptEmpty icon="search" title="Brak wyników" description="Zmień kryteria wyszukiwania.">
|
package/dist/empty/llms.txt
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# KptEmpty (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
An empty state
|
|
3
|
+
An empty state - an icon, a title, a description and optional actions.
|
|
4
4
|
Import: `import { KptEmpty } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
7
7
|
<div class="kpt-empty-host">
|
|
8
8
|
<div class="kpt-empty">
|
|
9
|
-
<div class="kpt-empty__icon"
|
|
9
|
+
<div class="kpt-empty__icon">...icon...</div>
|
|
10
10
|
<p class="kpt-empty__title">No results</p>
|
|
11
11
|
<p class="kpt-empty__desc">Adjust your search criteria.</p>
|
|
12
|
-
<div class="kpt-empty__actions"
|
|
12
|
+
<div class="kpt-empty__actions">...children...</div>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
## Props
|
|
17
|
-
- `icon`: string | null (default 'info-circle')
|
|
18
|
-
- `title`: string, `description`: string
|
|
19
|
-
- `headingLevel`: 1
|
|
20
|
-
- `children`
|
|
17
|
+
- `icon`: string | null (default 'info-circle') - a registry icon name; `null` hides it
|
|
18
|
+
- `title`: string, `description`: string - each row disappears when its text is empty
|
|
19
|
+
- `headingLevel`: 1-6 | null (default null) - makes the title a heading (`role="heading"` + `aria-level`)
|
|
20
|
+
- `children` - the actions under the description
|
|
21
21
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
22
22
|
|
|
23
23
|
## Examples
|
|
@@ -31,6 +31,6 @@ Import: `import { KptEmpty } from '@konce-pt/react';`
|
|
|
31
31
|
`--kpt-color-on-surface-muted` (the description), `--kpt-space-*`.
|
|
32
32
|
|
|
33
33
|
## Accessibility
|
|
34
|
-
The icon is decorative. The title is a styled paragraph unless `headingLevel` makes it a heading
|
|
34
|
+
The icon is decorative. The title is a styled paragraph unless `headingLevel` makes it a heading -
|
|
35
35
|
use that when the empty state stands in for a whole section. Replacing results with an empty state
|
|
36
|
-
is not announced; report
|
|
36
|
+
is not announced; report "0 results" in a live region of your own.
|
package/dist/fab/fab.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface KptFabProps extends ComponentPropsWithRef<'button'> {
|
|
|
9
9
|
hostProps?: KptHostProps<'span'>;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Floating Action Button
|
|
12
|
+
* Floating Action Button - okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
|
|
13
13
|
* z tekstem.
|
|
14
14
|
*
|
|
15
15
|
* W wariancie okrągłym `aria-label` jest niezbędny, bo przycisk nie ma tekstu; w `extended`
|
package/dist/fab/fab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../internal/cn.js";
|
|
3
3
|
/**
|
|
4
|
-
* Floating Action Button
|
|
4
|
+
* Floating Action Button - okrągły, wyniesiony przycisk akcji. `extended` robi z niego pigułkę
|
|
5
5
|
* z tekstem.
|
|
6
6
|
*
|
|
7
7
|
* W wariancie okrągłym `aria-label` jest niezbędny, bo przycisk nie ma tekstu; w `extended`
|
package/dist/fab/llms.txt
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
# KptFab (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
A floating action button
|
|
3
|
+
A floating action button - round and raised. `extended` turns it into a pill with text.
|
|
4
4
|
Import: `import { KptFab } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
7
7
|
<span class="kpt-fab-host">
|
|
8
|
-
<button class="kpt-fab" type="button" data-variant="filled" data-size="md" aria-label="Add"
|
|
8
|
+
<button class="kpt-fab" type="button" data-variant="filled" data-size="md" aria-label="Add">...icon...</button>
|
|
9
9
|
</span>
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
- `variant`: 'filled' | 'tonal' (default 'filled')
|
|
13
13
|
- `size`: 'md' | 'mini' (default 'md')
|
|
14
|
-
- `extended`: boolean
|
|
15
|
-
- `hostProps`
|
|
14
|
+
- `extended`: boolean - a pill with text next to the icon
|
|
15
|
+
- `hostProps` - props for the `.kpt-fab-host` wrapper
|
|
16
16
|
- `className`, `ref` and every other `<button>` prop go to the inner `<button>`
|
|
17
17
|
|
|
18
18
|
## The label depends on the variant
|
|
19
|
-
In the round variant `aria-label` is essential
|
|
19
|
+
In the round variant `aria-label` is essential - the button has no text. In `extended` the content
|
|
20
20
|
already is the label, so `aria-label` is dropped there rather than passed through: two names on one
|
|
21
21
|
control make a screen reader announce the wrong one.
|
|
22
22
|
|
|
23
23
|
## Placement is yours
|
|
24
|
-
The component does not position itself. It is a button, not a layout
|
|
24
|
+
The component does not position itself. It is a button, not a layout - put it in a container that
|
|
25
25
|
pins it wherever the design wants (usually `position: fixed` in a corner).
|
|
26
26
|
|
|
27
27
|
## Examples
|
|
@@ -29,6 +29,10 @@ pins it wherever the design wants (usually `position: fixed` in a corner).
|
|
|
29
29
|
<KptFab extended><KptIcon name="plus" /> New</KptFab>
|
|
30
30
|
<KptFab variant="tonal" size="mini" aria-label="Edit"><KptIcon name="copy" /></KptFab>
|
|
31
31
|
|
|
32
|
+
## Motion
|
|
33
|
+
Pressed, it squeezes slightly and springs back on release (shared mixin `styles/_press.scss`). Pure CSS; durations follow `--kpt-motion-scale`, so `enabled: false` turns it off, and it drops out
|
|
34
|
+
under "reduce motion".
|
|
35
|
+
|
|
32
36
|
## Tokens
|
|
33
37
|
`--kpt-color-primary` / `--kpt-color-on-primary` (filled), `--kpt-color-muted` /
|
|
34
38
|
`--kpt-color-on-muted` (tonal), `--kpt-elevation-3` (`--kpt-elevation-4` on hover); shape
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { type KptCollapseMotion } from '@konce-pt/motion';
|
|
3
|
+
export type KptFieldsetVariant = 'outlined' | 'filled';
|
|
2
4
|
export interface KptFieldsetProps extends ComponentPropsWithRef<'div'> {
|
|
3
5
|
legend?: string;
|
|
6
|
+
/**
|
|
7
|
+
* `outlined` (domyślny) - sama ramka na tle rodzica; `filled` - grupa na kolorze powierzchni,
|
|
8
|
+
* np. sekcje w szarym panelu. Legenda w obu bierze tło grupy, więc nie dzieli się na dwa kolory.
|
|
9
|
+
*/
|
|
10
|
+
variant?: KptFieldsetVariant;
|
|
4
11
|
/** Legenda staje się przyciskiem zwijającym zawartość. */
|
|
5
12
|
toggleable?: boolean;
|
|
6
13
|
collapsed?: boolean;
|
|
@@ -8,15 +15,22 @@ export interface KptFieldsetProps extends ComponentPropsWithRef<'div'> {
|
|
|
8
15
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
9
16
|
animated?: boolean;
|
|
10
17
|
animationDuration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Ruch zwijania: `spring` - wysokość na sprężynie, treść wjeżdża i wyostrza się, przy zwijaniu
|
|
20
|
+
* najpierw gaśnie; `fade` - treść się przenika; `none` - bez ruchu. Bez wartości bierze `collapse`
|
|
21
|
+
* z `KptMotionProvider` (domyślnie `spring`); `animated={false}`, `enabled={false}` i systemowe
|
|
22
|
+
* "ogranicz ruch" wyłączają go zawsze.
|
|
23
|
+
*/
|
|
24
|
+
collapseMotion?: KptCollapseMotion;
|
|
11
25
|
children?: ReactNode;
|
|
12
26
|
}
|
|
13
27
|
/**
|
|
14
28
|
* Grupa pól z legendą (`<fieldset>` + `<legend>`), opcjonalnie zwijana.
|
|
15
29
|
*
|
|
16
|
-
* Zwijanie idzie przez `grid-template-rows: 0fr
|
|
17
|
-
* treści
|
|
30
|
+
* Zwijanie idzie przez `grid-template-rows: 0fr -> 1fr`, więc animuje się do naturalnej wysokości
|
|
31
|
+
* treści - bez mierzenia czegokolwiek w JS.
|
|
18
32
|
*
|
|
19
33
|
* @example
|
|
20
|
-
* <KptFieldset legend="Dane osobowe" toggleable
|
|
34
|
+
* <KptFieldset legend="Dane osobowe" toggleable>...</KptFieldset>
|
|
21
35
|
*/
|
|
22
|
-
export declare function KptFieldset({ legend, toggleable, collapsed, defaultCollapsed, onCollapsedChange, animated, animationDuration, className, style, children, ...rest }: Readonly<KptFieldsetProps>): import("react").JSX.Element;
|
|
36
|
+
export declare function KptFieldset({ legend, variant, toggleable, collapsed, defaultCollapsed, onCollapsedChange, animated, animationDuration, collapseMotion, className, style, children, ...rest }: Readonly<KptFieldsetProps>): import("react").JSX.Element;
|
|
@@ -4,24 +4,27 @@ import { cn } from "../internal/cn.js";
|
|
|
4
4
|
import { useControllableState } from "../internal/use-controllable-state.js";
|
|
5
5
|
import { useKptId } from "../internal/use-id.js";
|
|
6
6
|
import { KptIcon } from "../icon/icon.js";
|
|
7
|
+
import { resolveCollapseMotion } from '@konce-pt/motion';
|
|
8
|
+
import { useKptMotion } from "../motion/motion-context.js";
|
|
7
9
|
/**
|
|
8
10
|
* Grupa pól z legendą (`<fieldset>` + `<legend>`), opcjonalnie zwijana.
|
|
9
11
|
*
|
|
10
|
-
* Zwijanie idzie przez `grid-template-rows: 0fr
|
|
11
|
-
* treści
|
|
12
|
+
* Zwijanie idzie przez `grid-template-rows: 0fr -> 1fr`, więc animuje się do naturalnej wysokości
|
|
13
|
+
* treści - bez mierzenia czegokolwiek w JS.
|
|
12
14
|
*
|
|
13
15
|
* @example
|
|
14
|
-
* <KptFieldset legend="Dane osobowe" toggleable
|
|
16
|
+
* <KptFieldset legend="Dane osobowe" toggleable>...</KptFieldset>
|
|
15
17
|
*/
|
|
16
|
-
export function KptFieldset({ legend = '', toggleable = false, collapsed, defaultCollapsed = false, onCollapsedChange, animated = true, animationDuration = 500, className, style, children, ...rest }) {
|
|
18
|
+
export function KptFieldset({ legend = '', variant = 'outlined', toggleable = false, collapsed, defaultCollapsed = false, onCollapsedChange, animated = true, animationDuration = 500, collapseMotion, className, style, children, ...rest }) {
|
|
17
19
|
const bodyId = useKptId(undefined, 'kpt-fieldset-body');
|
|
20
|
+
const motion = resolveCollapseMotion(collapseMotion, useKptMotion(), animated);
|
|
18
21
|
const [isCollapsed, setCollapsed] = useControllableState({
|
|
19
22
|
value: collapsed,
|
|
20
23
|
defaultValue: defaultCollapsed,
|
|
21
24
|
onChange: onCollapsedChange,
|
|
22
25
|
});
|
|
23
|
-
return (_jsx("div", { className: cn('kpt-fieldset-host', className), style: {
|
|
26
|
+
return (_jsx("div", { className: cn('kpt-fieldset-host', className), "data-variant": variant, style: {
|
|
24
27
|
['--kpt-anim-duration']: `${animated ? animationDuration : 0}ms`,
|
|
25
28
|
...style,
|
|
26
|
-
}, ...rest, children: _jsxs("fieldset", { className: "kpt-fieldset", children: [_jsx("legend", { className: "kpt-fieldset__legend", children: toggleable ? (_jsxs("button", { type: "button", className: "kpt-fieldset__toggle", "aria-expanded": !isCollapsed, "aria-controls": bodyId, onClick: () => setCollapsed(!isCollapsed), children: [_jsx(KptIcon, { name:
|
|
29
|
+
}, ...rest, children: _jsxs("fieldset", { className: "kpt-fieldset", "data-motion": motion, children: [_jsx("legend", { className: "kpt-fieldset__legend", children: toggleable ? (_jsxs("button", { type: "button", className: "kpt-fieldset__toggle", "aria-expanded": !isCollapsed, "aria-controls": bodyId, onClick: () => setCollapsed(!isCollapsed), children: [_jsx(KptIcon, { name: "chevron-down", className: cn('kpt-fieldset__chevron', !isCollapsed && 'is-open') }), _jsx("span", { children: legend })] })) : (_jsx("span", { children: legend })) }), _jsx("div", { id: bodyId, className: cn('kpt-fieldset__collapse', !isCollapsed && 'is-open'), inert: isCollapsed, children: _jsx("div", { className: "kpt-fieldset__collapse-inner", children: _jsx("div", { className: "kpt-fieldset__body", children: children }) }) })] }) }));
|
|
27
30
|
}
|