@konce-pt/react 0.11.2 → 0.14.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 +128 -64
- package/dist/accordion/accordion.d.ts +14 -6
- package/dist/accordion/accordion.js +25 -17
- package/dist/accordion/llms.txt +22 -10
- package/dist/alert/alert.d.ts +2 -2
- package/dist/alert/alert.js +3 -2
- package/dist/alert/llms.txt +10 -9
- package/dist/app-shell/app-shell.d.ts +14 -14
- package/dist/app-shell/app-shell.js +22 -15
- package/dist/app-shell/llms.txt +16 -15
- package/dist/auth/auth-types.d.ts +6 -6
- package/dist/auth/auth.d.ts +2 -2
- package/dist/auth/auth.js +24 -15
- package/dist/auth/llms.txt +12 -11
- package/dist/autocomplete/autocomplete.d.ts +19 -6
- package/dist/autocomplete/autocomplete.js +32 -11
- package/dist/autocomplete/llms.txt +19 -5
- package/dist/avatar/avatar.d.ts +6 -6
- package/dist/avatar/avatar.js +6 -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 +4 -3
- package/dist/avatar-group/llms.txt +8 -8
- package/dist/backdrop/backdrop.d.ts +7 -26
- package/dist/backdrop/backdrop.js +32 -27
- 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 +8 -3
- package/dist/bottom-sheet/bottom-sheet.js +5 -4
- package/dist/bottom-sheet/llms.txt +11 -8
- package/dist/breadcrumb/breadcrumb.d.ts +8 -2
- package/dist/breadcrumb/breadcrumb.js +11 -3
- package/dist/breadcrumb/llms.txt +10 -2
- package/dist/button/button.d.ts +3 -3
- package/dist/button/button.js +10 -9
- package/dist/button/llms.txt +27 -19
- package/dist/button-group/button-group.d.ts +18 -5
- package/dist/button-group/button-group.js +54 -6
- package/dist/button-group/llms.txt +27 -18
- package/dist/card/card.d.ts +8 -8
- package/dist/card/card.js +10 -9
- package/dist/card/llms.txt +20 -20
- package/dist/carousel/carousel.d.ts +6 -6
- package/dist/carousel/carousel.js +8 -5
- package/dist/carousel/llms.txt +10 -10
- package/dist/charts/chart-legend.d.ts +3 -3
- package/dist/charts/chart-legend.js +2 -1
- package/dist/charts/chart-tooltip.d.ts +3 -3
- package/dist/charts/chart-tooltip.js +1 -1
- package/dist/charts/chart.d.ts +4 -3
- package/dist/charts/chart.js +18 -10
- package/dist/charts/llms.txt +10 -7
- package/dist/charts-entry/public-api.js +2 -2
- package/dist/chat/chat.d.ts +17 -10
- package/dist/chat/chat.js +77 -23
- package/dist/chat/llms.txt +39 -15
- package/dist/chat-composer/chat-composer.d.ts +20 -7
- package/dist/chat-composer/chat-composer.js +29 -7
- 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 +10 -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 +19 -8
- 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 +4 -3
- package/dist/chat-typing/llms.txt +6 -6
- package/dist/checkbox/checkbox.d.ts +13 -6
- package/dist/checkbox/checkbox.js +31 -5
- package/dist/checkbox/llms.txt +26 -11
- package/dist/chip/chip.d.ts +4 -4
- package/dist/chip/chip.js +3 -2
- package/dist/chip/llms.txt +11 -11
- package/dist/chips-input/chips-input.d.ts +6 -4
- package/dist/chips-input/chips-input.js +47 -12
- package/dist/chips-input/llms.txt +18 -8
- package/dist/clock/clock.d.ts +11 -6
- package/dist/clock/clock.js +38 -8
- package/dist/clock/llms.txt +12 -8
- package/dist/color-picker/color-picker.d.ts +9 -5
- package/dist/color-picker/color-picker.js +37 -18
- package/dist/color-picker/llms.txt +8 -5
- package/dist/confirm/confirm-container.d.ts +3 -3
- package/dist/confirm/confirm-container.js +6 -5
- package/dist/confirm/confirm-store.d.ts +4 -4
- package/dist/confirm/confirm-store.js +11 -5
- package/dist/confirm/llms.txt +8 -7
- package/dist/context-menu/context-menu.d.ts +1 -1
- package/dist/context-menu/context-menu.js +37 -14
- package/dist/context-menu/llms.txt +10 -7
- package/dist/data-table/data-table-types.d.ts +5 -5
- package/dist/data-table/data-table.d.ts +37 -5
- package/dist/data-table/data-table.js +426 -119
- package/dist/data-table/export-csv.d.ts +3 -3
- package/dist/data-table/export-csv.js +8 -10
- package/dist/data-table/llms.txt +127 -79
- package/dist/data-view/data-view.d.ts +13 -5
- package/dist/data-view/data-view.js +68 -6
- package/dist/data-view/llms.txt +29 -10
- package/dist/date-range/date-range.d.ts +20 -8
- package/dist/date-range/date-range.js +86 -63
- package/dist/date-range/llms.txt +32 -18
- package/dist/datepicker/datepicker.d.ts +22 -8
- package/dist/datepicker/datepicker.js +103 -71
- package/dist/datepicker/llms.txt +36 -22
- package/dist/dialog/dialog.d.ts +4 -4
- package/dist/dialog/dialog.js +32 -11
- package/dist/dialog/llms.txt +13 -10
- package/dist/divider/divider.d.ts +7 -1
- package/dist/divider/divider.js +3 -2
- package/dist/divider/llms.txt +4 -3
- package/dist/drawer/drawer.d.ts +9 -4
- package/dist/drawer/drawer.js +5 -4
- package/dist/drawer/llms.txt +13 -10
- 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 +12 -6
- package/dist/fieldset/llms.txt +26 -9
- package/dist/file-upload/file-upload.d.ts +8 -2
- package/dist/file-upload/file-upload.js +22 -11
- package/dist/file-upload/llms.txt +12 -9
- 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 +27 -6
- package/dist/form-field/llms.txt +25 -11
- package/dist/galleria/galleria.d.ts +3 -3
- package/dist/galleria/galleria.js +9 -6
- 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 +6 -6
- package/dist/i18n/i18n-context.js +27 -5
- 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 +10 -7
- 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 +5 -5
- package/dist/image/llms.txt +13 -13
- package/dist/input/input.d.ts +18 -5
- package/dist/input/input.js +22 -6
- package/dist/input/llms.txt +25 -11
- package/dist/input-mask/input-mask.d.ts +7 -2
- package/dist/input-mask/input-mask.js +17 -43
- package/dist/input-mask/llms.txt +8 -5
- package/dist/input-number/input-number.d.ts +11 -9
- package/dist/input-number/input-number.js +25 -21
- package/dist/input-number/llms.txt +17 -14
- package/dist/input-otp/input-otp.d.ts +18 -5
- package/dist/input-otp/input-otp.js +48 -24
- package/dist/input-otp/llms.txt +18 -7
- 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 +14 -0
- package/dist/internal/mask.js +62 -0
- package/dist/internal/number-group.d.ts +22 -0
- package/dist/internal/number-group.js +53 -0
- package/dist/internal/option-key.d.ts +6 -0
- package/dist/internal/option-key.js +8 -0
- 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 +40 -10
- package/dist/internal/password-strength.d.ts +6 -0
- package/dist/internal/password-strength.js +74 -0
- package/dist/internal/roving.d.ts +2 -2
- package/dist/internal/roving.js +3 -3
- package/dist/internal/scroll-lock.d.ts +6 -0
- package/dist/internal/scroll-lock.js +35 -0
- package/dist/internal/slot-children.d.ts +13 -0
- package/dist/internal/slot-children.js +31 -0
- package/dist/internal/slot.d.ts +3 -3
- package/dist/internal/slot.js +2 -2
- package/dist/internal/step.d.ts +12 -0
- package/dist/internal/step.js +31 -0
- package/dist/internal/tween.d.ts +5 -5
- package/dist/internal/tween.js +7 -8
- 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 +5 -0
- package/dist/internal/use-controllable-state.js +25 -4
- 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 +2 -1
- package/dist/internal/use-modal-focus.js +14 -3
- package/dist/knob/knob.d.ts +7 -4
- package/dist/knob/knob.js +27 -22
- package/dist/knob/llms.txt +18 -11
- package/dist/listbox/listbox.d.ts +8 -6
- package/dist/listbox/listbox.js +37 -17
- package/dist/listbox/llms.txt +12 -9
- 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 +30 -23
- package/dist/map/map-create-dialog.d.ts +4 -4
- package/dist/map/map-create-dialog.js +36 -28
- package/dist/map/map-hours-field.d.ts +4 -4
- package/dist/map/map-hours-field.js +8 -7
- package/dist/map/map-image-field.d.ts +2 -2
- package/dist/map/map-image-field.js +6 -5
- package/dist/map/map-legend.d.ts +4 -4
- package/dist/map/map-legend.js +3 -2
- package/dist/map/map-poi-card.d.ts +3 -3
- package/dist/map/map-poi-card.js +10 -9
- package/dist/map/map-search.d.ts +17 -6
- package/dist/map/map-search.js +70 -43
- package/dist/map/map.d.ts +25 -13
- package/dist/map/map.js +86 -57
- 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 +18 -7
- package/dist/megamenu/megamenu.d.ts +12 -6
- package/dist/megamenu/megamenu.js +23 -14
- 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-rows.js +1 -0
- package/dist/menu/menu.d.ts +2 -2
- package/dist/menu/menu.js +15 -8
- package/dist/menubar/llms.txt +19 -8
- package/dist/menubar/menubar.d.ts +11 -5
- package/dist/menubar/menubar.js +23 -11
- 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 +2 -1
- package/dist/motion/motion-context.d.ts +22 -0
- package/dist/motion/motion-context.js +28 -0
- package/dist/order-list/llms.txt +24 -9
- package/dist/order-list/order-list.d.ts +12 -4
- package/dist/order-list/order-list.js +123 -25
- package/dist/paginator/llms.txt +8 -8
- package/dist/paginator/paginator.js +7 -4
- package/dist/panel/llms.txt +25 -13
- package/dist/panel/panel.d.ts +11 -3
- package/dist/panel/panel.js +12 -7
- package/dist/password/llms.txt +19 -7
- package/dist/password/password.d.ts +2 -2
- package/dist/password/password.js +27 -16
- package/dist/peek/llms.txt +11 -11
- package/dist/peek/peek.d.ts +6 -6
- package/dist/peek/peek.js +41 -19
- package/dist/pick-list/llms.txt +35 -12
- package/dist/pick-list/pick-list.d.ts +12 -4
- package/dist/pick-list/pick-list.js +128 -24
- package/dist/popover/llms.txt +13 -10
- package/dist/popover/popover.d.ts +6 -4
- package/dist/popover/popover.js +14 -7
- package/dist/progress/llms.txt +17 -17
- package/dist/progress/progress.d.ts +7 -7
- package/dist/progress/progress.js +7 -6
- package/dist/public-api.d.ts +16 -4
- package/dist/public-api.js +13 -7
- package/dist/radio-group/llms.txt +16 -6
- package/dist/radio-group/radio-group.d.ts +12 -3
- package/dist/radio-group/radio-group.js +23 -4
- 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 +77 -12
- package/dist/rich-text/lists.d.ts +2 -2
- package/dist/rich-text/lists.js +7 -7
- package/dist/rich-text/llms.txt +35 -12
- package/dist/rich-text/rich-text.d.ts +13 -14
- package/dist/rich-text/rich-text.js +311 -142
- package/dist/rich-text/sanitize.d.ts +11 -2
- package/dist/rich-text/sanitize.js +80 -32
- package/dist/rich-text/tables.d.ts +3 -3
- package/dist/rich-text/tables.js +3 -3
- package/dist/roadmap/llms.txt +23 -17
- package/dist/roadmap/roadmap.d.ts +6 -6
- package/dist/roadmap/roadmap.js +102 -25
- 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 +2 -1
- package/dist/select/llms.txt +22 -12
- package/dist/select/select.d.ts +10 -8
- package/dist/select/select.js +87 -47
- package/dist/shared/types.d.ts +22 -1
- package/dist/shared/types.js +9 -1
- package/dist/sidenav/llms.txt +9 -9
- package/dist/sidenav/sidenav.d.ts +2 -3
- package/dist/sidenav/sidenav.js +5 -4
- 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 +34 -12
- package/dist/slider/slider-drag.d.ts +26 -0
- package/dist/slider/slider-drag.js +79 -0
- package/dist/slider/slider.d.ts +8 -5
- package/dist/slider/slider.js +38 -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 +3 -2
- package/dist/spinner/llms.txt +7 -7
- package/dist/spinner/spinner.d.ts +1 -1
- package/dist/spinner/spinner.js +2 -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 +13 -6
- package/dist/splitter/llms.txt +11 -11
- package/dist/splitter/splitter.d.ts +3 -3
- package/dist/splitter/splitter.js +25 -10
- package/dist/stepper/llms.txt +35 -13
- package/dist/stepper/stepper.d.ts +6 -6
- package/dist/stepper/stepper.js +60 -13
- package/dist/switch/llms.txt +15 -5
- package/dist/switch/switch.d.ts +10 -3
- package/dist/switch/switch.js +18 -4
- package/dist/switch-group/llms.txt +11 -8
- package/dist/switch-group/switch-group.d.ts +6 -4
- package/dist/switch-group/switch-group.js +9 -7
- package/dist/tabs/llms.txt +12 -9
- package/dist/tabs/tabs.d.ts +5 -5
- package/dist/tabs/tabs.js +36 -20
- package/dist/textarea/llms.txt +23 -12
- package/dist/textarea/textarea.d.ts +19 -6
- package/dist/textarea/textarea.js +22 -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 +50 -17
- package/dist/toast/toast-container.d.ts +9 -3
- package/dist/toast/toast-container.js +18 -9
- package/dist/toast/toast-store.d.ts +42 -2
- 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 +14 -12
- package/dist/tooltip/tooltip.d.ts +5 -4
- package/dist/tooltip/tooltip.js +100 -41
- package/dist/tree/llms.txt +25 -11
- package/dist/tree/tree-keys.d.ts +5 -5
- package/dist/tree/tree-keys.js +7 -7
- package/dist/tree/tree.d.ts +17 -5
- package/dist/tree/tree.js +62 -20
- 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 +18 -15
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="https://ui.konce.pt/images/koncept_ui_lib.png" alt="Koncept UI
|
|
3
|
+
<img src="https://ui.konce.pt/images/koncept_ui_lib.png" alt="Koncept UI - React component library" width="100%" />
|
|
4
4
|
|
|
5
|
-
# Koncept UI
|
|
5
|
+
# Koncept UI - React
|
|
6
6
|
|
|
7
7
|
**Open-source React 19 component library on the Koncept UI design system.**
|
|
8
|
-
80+ components sharing the exact CSS layer with the Angular port
|
|
8
|
+
80+ components sharing the exact CSS layer with the Angular port - zero runtime dependencies.
|
|
9
9
|
|
|
10
10
|
[](https://www.npmjs.com/package/@konce-pt/react)
|
|
11
11
|
[](https://www.npmjs.com/package/@konce-pt/react)
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
|
|
25
25
|
## Why Koncept UI React
|
|
26
26
|
|
|
27
|
-
**Koncept UI** is a free, MIT-licensed design system. This package is its **React 19** port
|
|
27
|
+
**Koncept UI** is a free, MIT-licensed design system. This package is its **React 19** port - not a
|
|
28
28
|
lookalike, but the same rendering contract:
|
|
29
29
|
|
|
30
|
-
-
|
|
30
|
+
- **One CSS layer for both ports** - the same `kpt-*` classes, the same `--kpt-*` tokens, the same
|
|
31
31
|
`@layer kpt.*` ordering. The DOM tree matches the Angular port node for node, so an app can mix
|
|
32
32
|
the two and nothing shifts by a pixel.
|
|
33
|
-
-
|
|
33
|
+
- **Zero runtime dependencies** - no `clsx`, no `radix`, no CSS-in-JS. `cn`, `Slot` and
|
|
34
34
|
`composeRefs` ship with the package.
|
|
35
|
-
-
|
|
36
|
-
native `name`/`form`, so `<form action={
|
|
35
|
+
- **React 19 native** - `ref` is a plain prop (no `forwardRef`), and every form control renders a
|
|
36
|
+
native `name`/`form`, so `<form action={...}>` Actions and React Hook Form's `register()` work
|
|
37
37
|
**without an adapter**. Controls are usable controlled *and* uncontrolled.
|
|
38
|
-
-
|
|
38
|
+
- **Flagship data table** - sorting, global and per-column filters, pagination, virtual scroll
|
|
39
39
|
(5000+ rows), selection, column reorder & freeze, inline editing, summary row, CSV export.
|
|
40
|
-
-
|
|
40
|
+
- **100% tokenized** - every style is a `var(--kpt-*)` custom property. Light/dark theme, neutral
|
|
41
41
|
OKLCH palette. Rebrand by swapping one token layer.
|
|
42
|
-
-
|
|
42
|
+
- **Native elements first** - `<button>`, `<input>`, `<label>` wherever one exists, so keyboard and
|
|
43
43
|
screen-reader behaviour comes from the platform. Invalid state travels on `aria-invalid`, never on
|
|
44
44
|
a class.
|
|
45
|
-
-
|
|
45
|
+
- **i18n built in** - English (default) & Polish out of the box, runtime locale switch, add any
|
|
46
46
|
language with one JSON.
|
|
47
47
|
|
|
48
48
|
## Installation
|
|
@@ -52,13 +52,13 @@ npm i @konce-pt/react @konce-pt/tokens @konce-pt/styles
|
|
|
52
52
|
# or: pnpm add / yarn add
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
`react` and `react-dom` (
|
|
55
|
+
`react` and `react-dom` (`^19.2`) are peers you already have. Optional extras:
|
|
56
56
|
|
|
57
|
-
- [`@konce-pt/grid`](https://www.npmjs.com/package/@konce-pt/grid)
|
|
57
|
+
- [`@konce-pt/grid`](https://www.npmjs.com/package/@konce-pt/grid) - the mobile-first layout system;
|
|
58
58
|
its React components live in `@konce-pt/react/grid`.
|
|
59
|
-
- [`@konce-pt/validators`](https://www.npmjs.com/package/@konce-pt/validators)
|
|
59
|
+
- [`@konce-pt/validators`](https://www.npmjs.com/package/@konce-pt/validators) - Polish-market
|
|
60
60
|
validators (NIP, REGON, PESEL, IBAN, postal code).
|
|
61
|
-
- `leaflet` (`^1.9`)
|
|
61
|
+
- `leaflet` (`^1.9`) - an **optional** peer, needed only by `@konce-pt/react/map`, loaded through a
|
|
62
62
|
dynamic `import()`.
|
|
63
63
|
|
|
64
64
|
## Setup
|
|
@@ -69,8 +69,8 @@ The package ships **JavaScript only**. Load the shared CSS layer once, in your a
|
|
|
69
69
|
import '@konce-pt/tokens/css';
|
|
70
70
|
import '@konce-pt/tokens/css/dark';
|
|
71
71
|
import '@konce-pt/styles'; // reset, @layer ordering, theme
|
|
72
|
-
import '@konce-pt/styles/components'; // the component layer
|
|
73
|
-
import '@konce-pt/grid'; // optional
|
|
72
|
+
import '@konce-pt/styles/components'; // the component layer - REQUIRED, this is what styles kpt-*
|
|
73
|
+
import '@konce-pt/grid'; // optional - only if you use the layout classes
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
`@konce-pt/styles/components` is generated from the same SCSS the Angular port compiles into its own
|
|
@@ -79,15 +79,18 @@ runtime; React has no other source for them, so this import is not optional.
|
|
|
79
79
|
|
|
80
80
|
Dark theme: set `<html data-theme="dark">` (or rely on `prefers-color-scheme`).
|
|
81
81
|
|
|
82
|
+
**Next.js App Router / Server Components:** every interactive component module starts with
|
|
83
|
+
`'use client'`, so you can import components directly into a server component - no wrapper file.
|
|
84
|
+
|
|
82
85
|
> **No CDK here.** Components with a floating panel (`KptSelect`, `KptPopover`, `KptMenu`,
|
|
83
|
-
> `KptAutocomplete`, `KptDatepicker
|
|
84
|
-
> `KptOverlay`, so `@angular/cdk/overlay-prebuilt.css` is **not** needed
|
|
86
|
+
> `KptAutocomplete`, `KptDatepicker`...) portal into `document.body` through the internal
|
|
87
|
+
> `KptOverlay`, so `@angular/cdk/overlay-prebuilt.css` is **not** needed - positioning lives in the
|
|
85
88
|
> component, the look in `@konce-pt/styles/components`. Inside an open `KptDialog` those panels
|
|
86
89
|
> portal into the `<dialog>` instead, because `showModal()` moves it to the browser top layer.
|
|
87
90
|
|
|
88
91
|
## Quick start
|
|
89
92
|
|
|
90
|
-
A login form
|
|
93
|
+
A login form - controlled values, the error gated on touch, no form library required:
|
|
91
94
|
|
|
92
95
|
```tsx
|
|
93
96
|
import { useState } from 'react';
|
|
@@ -139,7 +142,7 @@ export function Login() {
|
|
|
139
142
|
|
|
140
143
|
`KptFormField` generates the control id and publishes it through context, so `label[for]` and
|
|
141
144
|
`input[id]` match with no configuration. Drop `value`/`onValueChange` and the field becomes
|
|
142
|
-
uncontrolled
|
|
145
|
+
uncontrolled - the value lives in the DOM, and a native `<form action={...}>` or React Hook Form's
|
|
143
146
|
`register()` picks it up as-is.
|
|
144
147
|
|
|
145
148
|
Data table with sorting, filtering, pagination and a custom cell:
|
|
@@ -165,7 +168,7 @@ Data table with sorting, filtering, pagination and a custom cell:
|
|
|
165
168
|
| --- | --- |
|
|
166
169
|
| **Forms** | `KptInput`, `KptTextarea`, `KptSelect`, `KptAutocomplete`, `KptCheckbox`, `KptSwitch`, `KptSwitchGroup`, `KptRadioGroup`, `KptSlider`, `KptRating`, `KptDatepicker`, `KptDateRange`, `KptClock`, `KptColorPicker`, `KptFileUpload`, `KptInputNumber`, `KptPassword`, `KptInputOtp`, `KptChipsInput`, `KptInputMask`, `KptListbox`, `KptKnob`, `KptRichText`, `KptFormField` |
|
|
167
170
|
| **Buttons & actions** | `KptButton`, `KptIconButton`, `KptButtonGroup`, `KptFab`, `KptSplitButton`, `KptSpeedDial` |
|
|
168
|
-
| **Layout** | `KptAppShell`, `KptToolbar`, `KptSidenav`, `KptCard` (+ `Header`, `Footer`, `Media`, `Title
|
|
171
|
+
| **Layout** | `KptAppShell`, `KptToolbar`, `KptSidenav`, `KptCard` (+ `Header`, `Footer`, `Media`, `Title`...), `KptDivider`, `KptPanel`, `KptFieldset`, `KptSplitter`, `KptScrollTop` |
|
|
169
172
|
| **Navigation** | `KptTabs`, `KptAccordion`, `KptBreadcrumb`, `KptStepper`, `KptMenu`, `KptMenubar`, `KptMegamenu`, `KptContextMenu` |
|
|
170
173
|
| **Data** | `KptDataTable`, `KptPaginator`, `KptTree`, `KptTimeline`, `KptCarousel`, `KptDataView`, `KptPickList`, `KptOrderList`, `KptGalleria`, `KptMeterGroup` |
|
|
171
174
|
| **Feedback & overlay** | `KptAlert`, `KptDialog`, `kptToast` + `KptToastContainer`, `KptTooltip`, `KptPopover`, `KptDrawer`, `KptBottomSheet`, `kptConfirm`, `KptBadge`, `KptChip`, `KptAvatar`, `KptAvatarGroup`, `KptSpinner`, `KptProgress`, `KptSkeleton`, `KptEmpty`, `KptImage`, `KptAuth` |
|
|
@@ -176,7 +179,7 @@ entry point stays small. Every component ships an `llms.txt` API sheet next to i
|
|
|
176
179
|
|
|
177
180
|
## Theming
|
|
178
181
|
|
|
179
|
-
All visuals are driven by `var(--kpt-*)` tokens (three tiers: primitives
|
|
182
|
+
All visuals are driven by `var(--kpt-*)` tokens (three tiers: primitives -> semantic -> component).
|
|
180
183
|
Override them in a stylesheet imported **after** `@konce-pt/styles`:
|
|
181
184
|
|
|
182
185
|
```css
|
|
@@ -189,41 +192,41 @@ Override them in a stylesheet imported **after** `@konce-pt/styles`:
|
|
|
189
192
|
}
|
|
190
193
|
```
|
|
191
194
|
|
|
192
|
-
**Common token names:** surfaces `--kpt-color-surface`, `--kpt-color-surface-sunken|raised|variant|hover|selected`; text `--kpt-color-on-surface`, `--kpt-color-on-surface-muted` (aliases `--kpt-color-text`, `--kpt-color-text-muted|subtle|inverse`); borders `--kpt-color-border`, `--kpt-color-border-strong`; accent roles in full
|
|
195
|
+
**Common token names:** surfaces `--kpt-color-surface`, `--kpt-color-surface-sunken|raised|variant|hover|selected`; text `--kpt-color-on-surface`, `--kpt-color-on-surface-muted` (aliases `--kpt-color-text`, `--kpt-color-text-muted|subtle|inverse`); borders `--kpt-color-border`, `--kpt-color-border-strong`; accent roles in full - `{primary,danger,success,warning,info}` each with `-hover`, `-contrast`, `-subtle`, `-border`; radii `--kpt-radius-sm|md|lg|xl|full|none`; elevation `--kpt-elevation-1..4` (aliases `--kpt-shadow-sm|md|lg`). There is no `--kpt-color-bg`.
|
|
193
196
|
|
|
194
197
|
Variants and sizes travel on `data-*` attributes (`data-variant`, `data-size`), never on modifier
|
|
195
|
-
classes
|
|
198
|
+
classes - that is what the SCSS reads.
|
|
196
199
|
|
|
197
200
|
## Icons
|
|
198
201
|
|
|
199
|
-
**84 icons are built in and need no configuration**
|
|
202
|
+
**84 icons are built in and need no configuration** - what the components themselves draw plus the
|
|
200
203
|
staples of an application shell (`sun`, `moon`, `bell`, `settings`, `users`, `logout`,
|
|
201
|
-
`layout-dashboard`, `home`, `activity`, `chart-bar`, `brand-github`
|
|
204
|
+
`layout-dashboard`, `home`, `activity`, `chart-bar`, `brand-github` ...). A typical admin panel needs
|
|
202
205
|
nothing else.
|
|
203
206
|
|
|
204
207
|
For the full **Tabler Icons** set (MIT, 5130 icons) there are two paths, and the difference is the
|
|
205
208
|
bundle. Every icon is its own export, so importing by name lets the bundler keep just those:
|
|
206
209
|
|
|
207
210
|
```tsx
|
|
208
|
-
// Production
|
|
211
|
+
// Production - two icons reach the bundle.
|
|
209
212
|
import { LayoutDashboard, Rocket } from '@konce-pt/react/icons';
|
|
210
213
|
import { registerKptIcons } from '@konce-pt/react';
|
|
211
214
|
registerKptIcons([LayoutDashboard, Rocket]);
|
|
212
215
|
|
|
213
|
-
// Prototype
|
|
216
|
+
// Prototype - every icon, about 1.2 MB.
|
|
214
217
|
import { registerKptTablerIcons } from '@konce-pt/react/icons';
|
|
215
218
|
registerKptTablerIcons();
|
|
216
219
|
```
|
|
217
220
|
|
|
218
221
|
`registerKptIcons` is the one that shrinks: it takes the data as an argument and imports nothing from
|
|
219
222
|
the Tabler subpath. For the same reason `registerKptIcons(tabler)` with a namespace import
|
|
220
|
-
(`import * as tabler`) registers everything
|
|
223
|
+
(`import * as tabler`) registers everything - a namespace object handed to a function blocks static
|
|
221
224
|
analysis. The registry is global, so one call at the app entry is enough; no provider needed.
|
|
222
225
|
|
|
223
226
|
## Internationalization (i18n)
|
|
224
227
|
|
|
225
228
|
Component labels ship in **English (default)** and **Polish**. Without a provider everything renders
|
|
226
|
-
in English
|
|
229
|
+
in English - a missing provider is never an error. `KptI18nProvider` sets the language for a subtree:
|
|
227
230
|
|
|
228
231
|
```tsx
|
|
229
232
|
import { KptI18nProvider, useKptI18n } from '@konce-pt/react';
|
|
@@ -255,7 +258,7 @@ English):
|
|
|
255
258
|
```tsx
|
|
256
259
|
import de from './i18n/de.json';
|
|
257
260
|
|
|
258
|
-
<KptI18nProvider locale="de" messages={{ de }}
|
|
261
|
+
<KptI18nProvider locale="de" messages={{ de }}>...</KptI18nProvider>
|
|
259
262
|
```
|
|
260
263
|
|
|
261
264
|
Any component with labels also accepts `locale` and `dictionary` props, which take priority over the
|
|
@@ -263,19 +266,52 @@ provider. Calendar weekday/month names come from the browser's `Intl` API. The c
|
|
|
263
266
|
dictionaries live in [`@konce-pt/i18n`](https://www.npmjs.com/package/@konce-pt/i18n), shared with
|
|
264
267
|
the Angular port.
|
|
265
268
|
|
|
269
|
+
## Motion
|
|
270
|
+
|
|
271
|
+
Components animate out of the box - springs, smooth layout changes, enter and exit - with **no provider**.
|
|
272
|
+
`KptMotionProvider` sets app-wide defaults: whether motion is on at all and which kind each group of
|
|
273
|
+
components gets. Every prop is optional; it writes to `<html>`, so overlays in portals follow it too.
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
import { KptMotionProvider } from '@konce-pt/react';
|
|
277
|
+
|
|
278
|
+
export function App() {
|
|
279
|
+
return (
|
|
280
|
+
<KptMotionProvider layout="arc" enter="fade">
|
|
281
|
+
<Routes />
|
|
282
|
+
</KptMotionProvider>
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// <KptMotionProvider enabled={false}> - no motion at all (visual tests, kiosk)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
| Key | Values | Components (per-component input) |
|
|
290
|
+
| --- | --- | --- |
|
|
291
|
+
| `enabled` | `true` \| `false` | All. `false` also zeroes CSS durations (`data-kpt-motion="off"`, `--kpt-motion-scale: 0` on `<html>`); loading indicators slow down instead of stopping |
|
|
292
|
+
| `layout` | `spring` \| `arc` \| `morph` \| `none` | DataView, PickList, OrderList (`layoutMotion`) |
|
|
293
|
+
| `collapse` | `spring` \| `fade` \| `none` | Accordion, Fieldset, Panel, Tree (`collapseMotion`) |
|
|
294
|
+
| `enter` | `spring` \| `fade` \| `none` | Chat, ChatMessage, ChatDock, FormField (`enterMotion`); Password meter, ChipsInput and Select chips |
|
|
295
|
+
| `toggle` | `spring` \| `fade` \| `none` | Checkbox, RadioGroup, Switch (`toggleMotion`); Rating stars, ButtonGroup selection |
|
|
296
|
+
|
|
297
|
+
Precedence: `enabled: false` always wins, then the component's own prop, then the provider value,
|
|
298
|
+
then `spring`. Small reactions (button press, field focus and error, slider handle) are plain CSS and follow
|
|
299
|
+
only `enabled`. The system "reduce motion" setting is always respected. The same springs and FLIP helpers
|
|
300
|
+
are available for your own views in [`@konce-pt/motion`](https://www.npmjs.com/package/@konce-pt/motion).
|
|
301
|
+
|
|
266
302
|
## Helpers
|
|
267
303
|
|
|
268
|
-
- `cn(...values)`
|
|
269
|
-
- `Slot` + the `asChild` prop
|
|
270
|
-
- `composeRefs(...refs)`
|
|
304
|
+
- `cn(...values)` - class-name joining (the `clsx` role, no dependency).
|
|
305
|
+
- `Slot` + the `asChild` prop - render as another element while keeping classes and attributes.
|
|
306
|
+
- `composeRefs(...refs)` - merge several refs into one callback.
|
|
271
307
|
|
|
272
308
|
## Documentation
|
|
273
309
|
|
|
274
|
-
- **Playground**
|
|
275
|
-
- **`llms.txt`**
|
|
310
|
+
- **Playground** - live demos with copyable code: [ui.konce.pt/react](https://ui.konce.pt/react).
|
|
311
|
+
- **`llms.txt`** - LLM-friendly API sheets per component, shipped inside the package; the
|
|
276
312
|
package-wide sheet lives at [ui.konce.pt/llms/react/llms.txt](https://ui.konce.pt/llms/react/llms.txt)
|
|
277
313
|
(PL mirror: [llms-pl.txt](https://ui.konce.pt/llms/react/llms-pl.txt)).
|
|
278
|
-
- **Security scanners**
|
|
314
|
+
- **Security scanners** - Socket.dev and similar tools flag i18n keys as domain names
|
|
279
315
|
(`.email`, `.today` and friends are real TLDs) and the map's default endpoints; the
|
|
280
316
|
[project sheet](https://ui.konce.pt/llms.txt) explains each alert under "Security scanners".
|
|
281
317
|
- Repository: [gitlab.com/konce-pt/koncept-ui](https://gitlab.com/konce-pt/koncept-ui)
|
|
@@ -288,24 +324,24 @@ MIT © konce.pt
|
|
|
288
324
|
|
|
289
325
|
<div align="center">
|
|
290
326
|
|
|
291
|
-
##
|
|
327
|
+
## Wersja polska
|
|
292
328
|
|
|
293
329
|
</div>
|
|
294
330
|
|
|
295
331
|
**Koncept UI** to darmowy system projektowy na licencji **MIT**. Ta paczka to jego port na
|
|
296
|
-
**Reacta 19**
|
|
332
|
+
**Reacta 19** - nie podobnie wyglądający zamiennik, tylko ten sam kontrakt renderowania.
|
|
297
333
|
|
|
298
|
-
-
|
|
334
|
+
- **Jedna warstwa CSS dla obu portów** - te same klasy `kpt-*`, te same tokeny `--kpt-*`, ta sama
|
|
299
335
|
kolejność `@layer kpt.*`. Drzewo DOM odpowiada wersji Angulara węzeł w węzeł.
|
|
300
|
-
-
|
|
301
|
-
-
|
|
336
|
+
- **Zero zależności runtime** - `cn`, `Slot` i `composeRefs` są w paczce.
|
|
337
|
+
- **React 19** - `ref` jako zwykły prop (bez `forwardRef`), kontrolki działają kontrolowane
|
|
302
338
|
i niekontrolowane, z natywnym `name`/`form` (React 19 Actions i React Hook Form bez adaptera).
|
|
303
|
-
-
|
|
339
|
+
- **Flagowa tabela danych** - sortowanie, filtry globalne i kolumnowe, paginacja, virtual scroll,
|
|
304
340
|
zaznaczanie, przestawianie i zamrażanie kolumn, edycja w miejscu, podsumowanie, eksport CSV.
|
|
305
|
-
-
|
|
306
|
-
-
|
|
341
|
+
- **100% na tokenach** - każdy styl to `var(--kpt-*)`. Motyw jasny/ciemny, neutralna paleta OKLCH.
|
|
342
|
+
- **Natywne elementy** - `<button>`, `<input>`, `<label>` wszędzie tam, gdzie istnieją; stan błędu
|
|
307
343
|
na `aria-invalid`, nie na klasie.
|
|
308
|
-
-
|
|
344
|
+
- **Wbudowane i18n** - angielski (domyślny) i polski, przełączanie w runtime, dowolny język
|
|
309
345
|
jednym plikiem JSON.
|
|
310
346
|
|
|
311
347
|
### Instalacja
|
|
@@ -314,9 +350,9 @@ MIT © konce.pt
|
|
|
314
350
|
npm i @konce-pt/react @konce-pt/tokens @konce-pt/styles
|
|
315
351
|
```
|
|
316
352
|
|
|
317
|
-
`react` i `react-dom` (
|
|
353
|
+
`react` i `react-dom` (`^19.2`) to peery, które masz już w aplikacji. Opcjonalnie:
|
|
318
354
|
`@konce-pt/grid` (układ; komponenty w `@konce-pt/react/grid`), `@konce-pt/validators`
|
|
319
|
-
(walidatory PL: NIP, REGON, PESEL, IBAN, kod pocztowy) oraz `leaflet` (`^1.9`)
|
|
355
|
+
(walidatory PL: NIP, REGON, PESEL, IBAN, kod pocztowy) oraz `leaflet` (`^1.9`) - **opcjonalny**
|
|
320
356
|
peer, potrzebny wyłącznie dla `@konce-pt/react/map`.
|
|
321
357
|
|
|
322
358
|
### Konfiguracja
|
|
@@ -327,52 +363,55 @@ Paczka wysyła **sam JavaScript**. CSS ładujesz raz, w wejściu aplikacji:
|
|
|
327
363
|
import '@konce-pt/tokens/css';
|
|
328
364
|
import '@konce-pt/tokens/css/dark';
|
|
329
365
|
import '@konce-pt/styles'; // reset, kolejność warstw, motyw
|
|
330
|
-
import '@konce-pt/styles/components'; // warstwa komponentów
|
|
331
|
-
import '@konce-pt/grid'; // opcjonalnie
|
|
366
|
+
import '@konce-pt/styles/components'; // warstwa komponentów - WYMAGANE, to ona styluje kpt-*
|
|
367
|
+
import '@konce-pt/grid'; // opcjonalnie - klasy układu
|
|
332
368
|
```
|
|
333
369
|
|
|
334
370
|
`@konce-pt/styles/components` powstaje z tego samego SCSS-a, który port Angulara kompiluje do
|
|
335
|
-
własnego bundla
|
|
371
|
+
własnego bundla - stąd identyczny wygląd obu portów. Angular wstrzykuje te style w runtime, React
|
|
336
372
|
nie ma dla nich innego źródła, więc ten import nie jest opcjonalny.
|
|
337
373
|
|
|
338
374
|
Motyw ciemny: `<html data-theme="dark">` (albo `prefers-color-scheme`). Nadpisania `--kpt-color-*`
|
|
339
375
|
w arkuszu importowanym **po** `@konce-pt/styles`.
|
|
340
376
|
|
|
377
|
+
**Next.js App Router / Server Components:** każdy moduł interaktywnego komponentu zaczyna się od
|
|
378
|
+
`'use client'`, więc komponenty importujesz wprost do komponentu serwerowego - bez pliku-opakowania.
|
|
379
|
+
|
|
341
380
|
> **CDK nie jest tu potrzebny.** Komponenty z panelem (`KptSelect`, `KptPopover`, `KptMenu`,
|
|
342
|
-
> `KptAutocomplete`, `KptDatepicker
|
|
381
|
+
> `KptAutocomplete`, `KptDatepicker`...) renderują go przez wewnętrzny `KptOverlay` do portalu na
|
|
343
382
|
> `document.body`, więc `@angular/cdk/overlay-prebuilt.css` nie jest wymagany. W otwartym
|
|
344
383
|
> `KptDialog` panel trafia do `<dialog>`, bo `showModal()` przenosi go do górnej warstwy przeglądarki.
|
|
345
384
|
|
|
346
385
|
### Ikony
|
|
347
386
|
|
|
348
|
-
**84 ikony są wbudowane i nie wymagają konfiguracji**
|
|
387
|
+
**84 ikony są wbudowane i nie wymagają konfiguracji** - to, co rysują same komponenty, plus staple
|
|
349
388
|
powłoki aplikacji (`sun`, `moon`, `bell`, `settings`, `users`, `logout`, `layout-dashboard`,
|
|
350
|
-
`home`, `activity`, `chart-bar`, `brand-github
|
|
389
|
+
`home`, `activity`, `chart-bar`, `brand-github`...). Typowy panel administracyjny nie potrzebuje nic
|
|
351
390
|
więcej.
|
|
352
391
|
|
|
353
392
|
Pełny zestaw **Tabler Icons** (MIT, 5130 ikon) ma dwie ścieżki, a różnica jest w bundlu. Każda ikona
|
|
354
393
|
jest osobnym eksportem, więc import po nazwie zostawia w bundlu wyłącznie użyte:
|
|
355
394
|
|
|
356
395
|
```tsx
|
|
357
|
-
// Produkcja
|
|
396
|
+
// Produkcja - do bundla wchodzą dwie ikony.
|
|
358
397
|
import { LayoutDashboard, Rocket } from '@konce-pt/react/icons';
|
|
359
398
|
import { registerKptIcons } from '@konce-pt/react';
|
|
360
399
|
registerKptIcons([LayoutDashboard, Rocket]);
|
|
361
400
|
|
|
362
|
-
// Prototyp
|
|
401
|
+
// Prototyp - wszystkie ikony, około 1,2 MB.
|
|
363
402
|
import { registerKptTablerIcons } from '@konce-pt/react/icons';
|
|
364
403
|
registerKptTablerIcons();
|
|
365
404
|
```
|
|
366
405
|
|
|
367
406
|
To `registerKptIcons` odchudza, bo przyjmuje dane argumentem i sam nie importuje pełnego zestawu.
|
|
368
407
|
Z tego samego powodu `registerKptIcons(tabler)` z importem przestrzeni nazw (`import * as tabler`)
|
|
369
|
-
rejestruje komplet
|
|
408
|
+
rejestruje komplet - namespace przekazany do funkcji blokuje analizę statyczną. Rejestr jest
|
|
370
409
|
globalny, więc wystarczy jedno wywołanie w wejściu aplikacji.
|
|
371
410
|
|
|
372
411
|
### Internacjonalizacja (i18n)
|
|
373
412
|
|
|
374
413
|
Etykiety są dostępne po **angielsku (domyślnie)** i **polsku**. Bez providera wszystko renderuje się
|
|
375
|
-
po angielsku
|
|
414
|
+
po angielsku - brak providera nigdy nie jest błędem. `<KptI18nProvider locale="pl">` ustawia język
|
|
376
415
|
dla poddrzewa, `useKptI18n()` zwraca `{ locale, setLocale, messages, messagesFor, t }`, a
|
|
377
416
|
`t('paginator.range', { start: 1, end: 10, total: 42 })` interpoluje `{nazwa}` i spada na EN, potem
|
|
378
417
|
na sam klucz.
|
|
@@ -383,17 +422,42 @@ na EN):
|
|
|
383
422
|
```tsx
|
|
384
423
|
import de from './i18n/de.json';
|
|
385
424
|
|
|
386
|
-
<KptI18nProvider locale="de" messages={{ de }}
|
|
425
|
+
<KptI18nProvider locale="de" messages={{ de }}>...</KptI18nProvider>
|
|
387
426
|
```
|
|
388
427
|
|
|
389
428
|
Propsy `locale` i `dictionary` na komponencie mają priorytet nad providerem. Nazwy dni i miesięcy
|
|
390
429
|
w kalendarzach pochodzą z `Intl`. Kontrakt i słowniki żyją w `@konce-pt/i18n`, wspólnym z portem
|
|
391
430
|
Angulara.
|
|
392
431
|
|
|
432
|
+
### Animacje
|
|
433
|
+
|
|
434
|
+
Komponenty animują się od razu - sprężyny, płynne zmiany układu, wejścia i wyjścia - **bez providera**.
|
|
435
|
+
`KptMotionProvider` ustawia wartości domyślne dla całej aplikacji: czy ruch w ogóle jest włączony i jaki
|
|
436
|
+
rodzaj dostaje każda grupa komponentów. Każdy prop jest opcjonalny; provider pisze do `<html>`, więc
|
|
437
|
+
nakładki w portalach też go słuchają.
|
|
438
|
+
|
|
439
|
+
```tsx
|
|
440
|
+
<KptMotionProvider layout="arc" enter="fade">...</KptMotionProvider>
|
|
441
|
+
<KptMotionProvider enabled={false}>...</KptMotionProvider> {/* bez ruchu (testy wizualne, kiosk) */}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
| Klucz | Wartości | Komponenty (input per komponent) |
|
|
445
|
+
| --- | --- | --- |
|
|
446
|
+
| `enabled` | `true` \| `false` | Wszystkie. `false` zeruje też czasy w CSS (`data-kpt-motion="off"`, `--kpt-motion-scale: 0` na `<html>`); wskaźniki ładowania zwalniają zamiast stanąć |
|
|
447
|
+
| `layout` | `spring` \| `arc` \| `morph` \| `none` | DataView, PickList, OrderList (`layoutMotion`) |
|
|
448
|
+
| `collapse` | `spring` \| `fade` \| `none` | Accordion, Fieldset, Panel, Tree (`collapseMotion`) |
|
|
449
|
+
| `enter` | `spring` \| `fade` \| `none` | Chat, ChatMessage, ChatDock, FormField (`enterMotion`); miernik hasła, chipy ChipsInput i Select |
|
|
450
|
+
| `toggle` | `spring` \| `fade` \| `none` | Checkbox, RadioGroup, Switch (`toggleMotion`); gwiazdki Rating, wybór ButtonGroup |
|
|
451
|
+
|
|
452
|
+
Pierwszeństwo: `enabled: false` wygrywa zawsze, potem prop samego komponentu, potem wartość z providera,
|
|
453
|
+
a na końcu `spring`. Drobne reakcje (wciśnięcie przycisku, fokus i błąd pola, uchwyt suwaka) to czysty CSS
|
|
454
|
+
i idą tylko za `enabled`. Systemowe "ogranicz ruch" jest respektowane zawsze. Te same sprężyny i pomocniki
|
|
455
|
+
FLIP dla własnych widoków są w [`@konce-pt/motion`](https://www.npmjs.com/package/@konce-pt/motion).
|
|
456
|
+
|
|
393
457
|
### Komponenty (80+)
|
|
394
458
|
|
|
395
459
|
Formularze, przyciski i akcje, layout, nawigacja, dane (z flagową `KptDataTable`), feedback
|
|
396
|
-
i overlay
|
|
460
|
+
i overlay - pełna lista w tabeli powyżej. Ciężkie rzeczy (wykresy, czat, roadmapa, mapy, pełny Tabler)
|
|
397
461
|
siedzą w subpathach `@konce-pt/react/{charts,chat,roadmap,grid,map,icons}`, żeby nie obciążać rdzenia.
|
|
398
462
|
Każdy komponent ma obok źródła plik `llms.txt` z opisem API.
|
|
399
463
|
|
|
@@ -404,8 +468,8 @@ Playground z demami: [ui.konce.pt/react](https://ui.konce.pt/react). Opisy API d
|
|
|
404
468
|
[`llms-pl.txt`](https://ui.konce.pt/llms/react/llms-pl.txt) (PL). Repozytorium:
|
|
405
469
|
[gitlab.com/konce-pt/koncept-ui](https://gitlab.com/konce-pt/koncept-ui).
|
|
406
470
|
|
|
407
|
-
Alerty skanerów łańcucha dostaw (Socket.dev i podobne)
|
|
408
|
-
oraz domyślne endpointy mapy
|
|
471
|
+
Alerty skanerów łańcucha dostaw (Socket.dev i podobne) - klucze i18n czytane jak domeny
|
|
472
|
+
oraz domyślne endpointy mapy - omawia sekcja "Skanery bezpieczeństwa" w
|
|
409
473
|
[arkuszu projektu](https://ui.konce.pt/llms-pl.txt).
|
|
410
474
|
|
|
411
475
|
### Licencja
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type KptCollapseMotion } from '@konce-pt/motion';
|
|
2
3
|
export interface KptAccordionProps extends ComponentPropsWithRef<'div'> {
|
|
3
4
|
/** Pozwala trzymać otwartych wiele paneli naraz. */
|
|
4
5
|
multi?: boolean;
|
|
5
6
|
animated?: boolean;
|
|
6
7
|
animationDuration?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ruch zwijania: `spring` - wysokość na sprężynie, treść wjeżdża i wyostrza się, przy zwijaniu
|
|
10
|
+
* najpierw gaśnie; `fade` - treść się przenika; `none` - bez ruchu. Bez wartości bierze `collapse`
|
|
11
|
+
* z `KptMotionProvider` (domyślnie `spring`); `animated={false}`, `enabled={false}` i systemowe
|
|
12
|
+
* "ogranicz ruch" wyłączają go zawsze.
|
|
13
|
+
*/
|
|
14
|
+
collapseMotion?: KptCollapseMotion;
|
|
7
15
|
/** Indeksy otwartych paneli. */
|
|
8
16
|
openIndexes?: number[];
|
|
9
17
|
defaultOpenIndexes?: number[];
|
|
@@ -11,19 +19,19 @@ export interface KptAccordionProps extends ComponentPropsWithRef<'div'> {
|
|
|
11
19
|
children?: ReactNode;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
|
-
* Akordeon
|
|
22
|
+
* Akordeon - grupa rozwijanych paneli. `multi` pozwala otworzyć wiele naraz.
|
|
15
23
|
*
|
|
16
|
-
* Stan otwarcia trzyma akordeon, a panele dostają swój indeks przez klonowanie
|
|
24
|
+
* Stan otwarcia trzyma akordeon, a panele dostają swój indeks przez klonowanie - inaczej
|
|
17
25
|
* pojedynczy tryb nie miałby jak zamknąć rodzeństwa. Panel użyty samodzielnie, poza akordeonem,
|
|
18
26
|
* zarządza sobą sam.
|
|
19
27
|
*
|
|
20
28
|
* @example
|
|
21
29
|
* <KptAccordion>
|
|
22
|
-
* <KptAccordion.Panel title="Sekcja 1"
|
|
23
|
-
* <KptAccordion.Panel title="Sekcja 2"
|
|
30
|
+
* <KptAccordion.Panel title="Sekcja 1">...</KptAccordion.Panel>
|
|
31
|
+
* <KptAccordion.Panel title="Sekcja 2">...</KptAccordion.Panel>
|
|
24
32
|
* </KptAccordion>
|
|
25
33
|
*/
|
|
26
|
-
export declare function KptAccordion({ multi, animated, animationDuration, openIndexes, defaultOpenIndexes, onOpenIndexesChange, className, children, ...rest }: Readonly<KptAccordionProps>): import("react").JSX.Element;
|
|
34
|
+
export declare function KptAccordion({ multi, animated, animationDuration, collapseMotion, openIndexes, defaultOpenIndexes, onOpenIndexesChange, className, children, ...rest }: Readonly<KptAccordionProps>): import("react").JSX.Element;
|
|
27
35
|
export declare namespace KptAccordion {
|
|
28
36
|
var Panel: typeof KptAccordionPanel;
|
|
29
37
|
}
|
|
@@ -34,7 +42,7 @@ export interface KptAccordionPanelProps extends Omit<ComponentPropsWithRef<'div'
|
|
|
34
42
|
expanded?: boolean;
|
|
35
43
|
defaultExpanded?: boolean;
|
|
36
44
|
onExpandedChange?: (expanded: boolean) => void;
|
|
37
|
-
/** Wstawiany przez akordeon
|
|
45
|
+
/** Wstawiany przez akordeon - nie podawaj ręcznie. */
|
|
38
46
|
index?: number;
|
|
39
47
|
children?: ReactNode;
|
|
40
48
|
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
+
import { cloneElement, createContext, isValidElement, useContext, } from 'react';
|
|
3
4
|
import { cn } from "../internal/cn.js";
|
|
5
|
+
import { slotChildren } from "../internal/slot-children.js";
|
|
4
6
|
import { useControllableState } from "../internal/use-controllable-state.js";
|
|
5
7
|
import { useKptId } from "../internal/use-id.js";
|
|
6
8
|
import { KptIcon } from "../icon/icon.js";
|
|
9
|
+
import { resolveCollapseMotion } from '@konce-pt/motion';
|
|
10
|
+
import { useKptMotion } from "../motion/motion-context.js";
|
|
7
11
|
const AccordionContext = createContext(null);
|
|
8
12
|
/**
|
|
9
|
-
* Akordeon
|
|
13
|
+
* Akordeon - grupa rozwijanych paneli. `multi` pozwala otworzyć wiele naraz.
|
|
10
14
|
*
|
|
11
|
-
* Stan otwarcia trzyma akordeon, a panele dostają swój indeks przez klonowanie
|
|
15
|
+
* Stan otwarcia trzyma akordeon, a panele dostają swój indeks przez klonowanie - inaczej
|
|
12
16
|
* pojedynczy tryb nie miałby jak zamknąć rodzeństwa. Panel użyty samodzielnie, poza akordeonem,
|
|
13
17
|
* zarządza sobą sam.
|
|
14
18
|
*
|
|
15
19
|
* @example
|
|
16
20
|
* <KptAccordion>
|
|
17
|
-
* <KptAccordion.Panel title="Sekcja 1"
|
|
18
|
-
* <KptAccordion.Panel title="Sekcja 2"
|
|
21
|
+
* <KptAccordion.Panel title="Sekcja 1">...</KptAccordion.Panel>
|
|
22
|
+
* <KptAccordion.Panel title="Sekcja 2">...</KptAccordion.Panel>
|
|
19
23
|
* </KptAccordion>
|
|
20
24
|
*/
|
|
21
|
-
export function KptAccordion({ multi = false, animated = true, animationDuration = 500, openIndexes, defaultOpenIndexes = [], onOpenIndexesChange, className, children, ...rest }) {
|
|
25
|
+
export function KptAccordion({ multi = false, animated = true, animationDuration = 500, collapseMotion, openIndexes, defaultOpenIndexes = [], onOpenIndexesChange, className, children, ...rest }) {
|
|
26
|
+
const motionConfig = useKptMotion();
|
|
22
27
|
const [open, setOpen] = useControllableState({
|
|
23
28
|
value: openIndexes,
|
|
24
29
|
defaultValue: defaultOpenIndexes,
|
|
@@ -33,20 +38,23 @@ export function KptAccordion({ multi = false, animated = true, animationDuration
|
|
|
33
38
|
setOpen(multi ? [...open, index] : [index]);
|
|
34
39
|
},
|
|
35
40
|
animMs: `${animated ? animationDuration : 0}ms`,
|
|
41
|
+
motion: resolveCollapseMotion(collapseMotion, motionConfig, animated),
|
|
36
42
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
index
|
|
43
|
-
|
|
44
|
-
});
|
|
43
|
+
// Indeks panelu = liczba paneli przed nim; fragmenty rozwinięte, więc panel z warunku też się liczy.
|
|
44
|
+
const items = slotChildren(children);
|
|
45
|
+
const isPanel = (child) => isValidElement(child) && child.type?.kptAccordionSlot === 'panel';
|
|
46
|
+
const panelIndex = items.map((_, at) => items.slice(0, at).filter(isPanel).length);
|
|
47
|
+
const panels = items.map((child, at) => isPanel(child)
|
|
48
|
+
? cloneElement(child, { key: child.key ?? `panel-${panelIndex[at]}`, index: panelIndex[at] })
|
|
49
|
+
: isValidElement(child) ? cloneElement(child, { key: child.key ?? `child-${at}` }) : child);
|
|
45
50
|
return (_jsx(AccordionContext.Provider, { value: context, children: _jsx("div", { className: cn('kpt-accordion-host', className), ...rest, children: panels }) }));
|
|
46
51
|
}
|
|
47
52
|
/** Panel akordeonu. Umieszczaj w `<KptAccordion>` albo używaj samodzielnie. */
|
|
48
53
|
export function KptAccordionPanel({ title, disabled = false, expanded, defaultExpanded = false, onExpandedChange, index, className, style, children, ...rest }) {
|
|
49
54
|
const accordion = useContext(AccordionContext);
|
|
55
|
+
const motionConfig = useKptMotion();
|
|
56
|
+
// Panel poza akordeonem zachowuje się jak w akordeonie z domyślną konfiguracją.
|
|
57
|
+
const motion = accordion?.motion ?? resolveCollapseMotion(undefined, motionConfig);
|
|
50
58
|
const uid = useKptId(undefined, 'kpt-accordion');
|
|
51
59
|
const headerId = `${uid}-header`;
|
|
52
60
|
const bodyId = `${uid}-body`;
|
|
@@ -67,9 +75,9 @@ export function KptAccordionPanel({ title, disabled = false, expanded, defaultEx
|
|
|
67
75
|
setStandalone(willOpen);
|
|
68
76
|
onExpandedChange?.(willOpen);
|
|
69
77
|
};
|
|
70
|
-
return (_jsx("div", { className: cn('kpt-accordion-panel-host', className), style: { ['--kpt-anim-duration']: accordion?.animMs ?? '500ms', ...style }, ...rest, children: _jsxs("div", { className: cn('kpt-accordion-panel', isOpen && 'is-open'), children: [_jsxs("button", { type: "button", className: "kpt-accordion-panel__header", id: headerId, "aria-expanded": isOpen, "aria-controls": bodyId, disabled: disabled, onClick: toggle, children: [_jsx("span", { className: "kpt-accordion-panel__title", children: title }), _jsx(KptIcon, { name: "chevron-down", className: cn('kpt-accordion-panel__chevron', isOpen && 'is-open') })] }), _jsx("div", { className: cn('kpt-accordion-panel__collapse', isOpen && 'is-open'),
|
|
71
|
-
// Treść to region nazwany nagłówkiem
|
|
72
|
-
role: "region", id: bodyId, "aria-labelledby": headerId, inert: !isOpen,
|
|
78
|
+
return (_jsx("div", { className: cn('kpt-accordion-panel-host', className), style: { ['--kpt-anim-duration']: accordion?.animMs ?? '500ms', ...style }, ...rest, children: _jsxs("div", { className: cn('kpt-accordion-panel', isOpen && 'is-open'), "data-motion": motion, children: [_jsxs("button", { type: "button", className: "kpt-accordion-panel__header", id: headerId, "aria-expanded": isOpen, "aria-controls": bodyId, disabled: disabled, onClick: toggle, children: [_jsx("span", { className: "kpt-accordion-panel__title", children: title }), _jsx(KptIcon, { name: "chevron-down", className: cn('kpt-accordion-panel__chevron', isOpen && 'is-open') })] }), _jsx("div", { className: cn('kpt-accordion-panel__collapse', isOpen && 'is-open'),
|
|
79
|
+
// Treść to region nazwany nagłówkiem - czytnik ogłasza nie tylko stan, ale i to, czego dotyczy.
|
|
80
|
+
role: "region", id: bodyId, "aria-labelledby": headerId, inert: !isOpen, children: _jsx("div", { className: "kpt-accordion-panel__collapse-inner", children: _jsx("div", { className: "kpt-accordion-panel__body", children: children }) }) })] }) }));
|
|
73
81
|
}
|
|
74
82
|
KptAccordionPanel.kptAccordionSlot = 'panel';
|
|
75
83
|
KptAccordion.Panel = KptAccordionPanel;
|
package/dist/accordion/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KptAccordion (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
An accordion
|
|
3
|
+
An accordion - a group of expandable panels. `multi` allows several open at once.
|
|
4
4
|
Import: `import { KptAccordion } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
@@ -10,12 +10,12 @@ Import: `import { KptAccordion } from '@konce-pt/react';`
|
|
|
10
10
|
<button class="kpt-accordion-panel__header" id="kpt-accordion-r1-header"
|
|
11
11
|
aria-expanded="true" aria-controls="kpt-accordion-r1-body">
|
|
12
12
|
<span class="kpt-accordion-panel__title">Section 1</span>
|
|
13
|
-
<span class="kpt-icon-host kpt-accordion-panel__chevron is-open"
|
|
13
|
+
<span class="kpt-icon-host kpt-accordion-panel__chevron is-open">...</span>
|
|
14
14
|
</button>
|
|
15
15
|
<div class="kpt-accordion-panel__collapse is-open" role="region" id="kpt-accordion-r1-body"
|
|
16
16
|
aria-labelledby="kpt-accordion-r1-header">
|
|
17
17
|
<div class="kpt-accordion-panel__collapse-inner">
|
|
18
|
-
<div class="kpt-accordion-panel__body"
|
|
18
|
+
<div class="kpt-accordion-panel__body">...children...</div>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
@@ -23,17 +23,18 @@ Import: `import { KptAccordion } from '@konce-pt/react';`
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
25
|
## KptAccordion props
|
|
26
|
-
- `multi`: boolean
|
|
27
|
-
- `openIndexes` / `defaultOpenIndexes` / `onOpenIndexesChange`
|
|
26
|
+
- `multi`: boolean - several panels open at once
|
|
27
|
+
- `openIndexes` / `defaultOpenIndexes` / `onOpenIndexesChange` - the open state, by index
|
|
28
28
|
- `animated`: boolean (default true), `animationDuration`: number (ms, default 500)
|
|
29
|
+
- `collapseMotion`: `'spring' | 'fade' | 'none'` (default from `KptMotionProvider`, else `spring`) - see "Collapse motion"
|
|
29
30
|
|
|
30
31
|
## KptAccordion.Panel props
|
|
31
32
|
- `title` (required), `disabled`
|
|
32
|
-
- `expanded` / `defaultExpanded` / `onExpandedChange`
|
|
33
|
+
- `expanded` / `defaultExpanded` / `onExpandedChange` - used when the panel stands alone
|
|
33
34
|
- `children`
|
|
34
35
|
|
|
35
36
|
## Who owns the state
|
|
36
|
-
The accordion owns it, and panels receive their index by cloning
|
|
37
|
+
The accordion owns it, and panels receive their index by cloning - without that, single mode would
|
|
37
38
|
have no way to close its siblings. A panel used outside an accordion falls back to its own state, so
|
|
38
39
|
it works standalone with no extra wrapper.
|
|
39
40
|
|
|
@@ -43,11 +44,22 @@ nothing inside takes focus or reaches a screen reader.
|
|
|
43
44
|
|
|
44
45
|
## Examples
|
|
45
46
|
<KptAccordion defaultOpenIndexes={[0]}>
|
|
46
|
-
<KptAccordion.Panel title="Section 1"
|
|
47
|
-
<KptAccordion.Panel title="Section 2"
|
|
47
|
+
<KptAccordion.Panel title="Section 1">...</KptAccordion.Panel>
|
|
48
|
+
<KptAccordion.Panel title="Section 2">...</KptAccordion.Panel>
|
|
48
49
|
</KptAccordion>
|
|
49
50
|
|
|
50
|
-
<KptAccordion multi openIndexes={open} onOpenIndexesChange={setOpen}
|
|
51
|
+
<KptAccordion multi openIndexes={open} onOpenIndexesChange={setOpen}>...</KptAccordion>
|
|
52
|
+
|
|
53
|
+
## Collapse motion
|
|
54
|
+
- `spring` - the height opens on a soft spring, the content slides in from above and sharpens out
|
|
55
|
+
of a blur; when collapsing, the content fades first and only then the section closes. The chevron
|
|
56
|
+
turns on a spring.
|
|
57
|
+
- `fade` - the height on the standard curve, the content cross-fades.
|
|
58
|
+
- `none` - the state changes without motion.
|
|
59
|
+
|
|
60
|
+
With no value it takes `collapse` from `KptMotionProvider` (default `spring`). `animated={false}` on the accordion, `enabled: false`
|
|
61
|
+
in the config and the system "reduce motion" setting always turn it off. `animationDuration` sets
|
|
62
|
+
the time of every kind. Pure CSS: the kind sits in `data-motion` on the component root.
|
|
51
63
|
|
|
52
64
|
## Tokens
|
|
53
65
|
`--kpt-color-border`, `--kpt-color-surface`, `--kpt-motion-easing-standard`, plus
|
package/dist/alert/alert.d.ts
CHANGED
|
@@ -22,10 +22,10 @@ export interface KptAlertProps extends Omit<ComponentPropsWithRef<'div'>, 'title
|
|
|
22
22
|
* go. `visible`/`onVisibleChange` pozwalają pokazać go ponownie z zewnątrz.
|
|
23
23
|
*
|
|
24
24
|
* Rola idzie za wagą komunikatu: `info` i `success` to `role="status"` (czytnik ogłosi je uprzejmie,
|
|
25
|
-
* nie przerywając), `warning` i `danger`
|
|
25
|
+
* nie przerywając), `warning` i `danger` - `role="alert"` (natychmiast).
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* <KptAlert variant="success" title="Zapisano">Zmiany zostały zapisane.</KptAlert>
|
|
29
|
-
* <KptAlert variant="warning" dismissible onClosed={onClosed}>Uwaga
|
|
29
|
+
* <KptAlert variant="warning" dismissible onClosed={onClosed}>Uwaga...</KptAlert>
|
|
30
30
|
*/
|
|
31
31
|
export declare function KptAlert({ variant, title, dismissible, onClosed, visible, defaultVisible, onVisibleChange, locale, dictionary, className, children, ...rest }: Readonly<KptAlertProps>): import("react").JSX.Element;
|