@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/grid/grid.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { cn } from "../internal/cn.js";
|
|
2
2
|
import { layoutStyle, renderLayout } from "./layout.js";
|
|
3
3
|
/**
|
|
4
|
-
* Siatka Koncept UI
|
|
4
|
+
* Siatka Koncept UI - CSS Grid sterowany custom properties z `@konce-pt/grid`.
|
|
5
5
|
*
|
|
6
6
|
* Odpowiednik dyrektywy `kptGrid` z portu Angulara. Dyrektyw w Reakcie nie ma, więc siatka jest
|
|
7
|
-
* komponentem
|
|
7
|
+
* komponentem - ale takim, który w trybie `asChild` niczego nie dokłada do DOM: przejmuje element,
|
|
8
8
|
* który i tak renderujesz (`<section>`, `<ul>`, `<main>`).
|
|
9
9
|
*
|
|
10
|
-
* Zmiana `columns` nie manipuluje klasami
|
|
10
|
+
* Zmiana `columns` nie manipuluje klasami - ustawia zmienną inline, a układ przelicza
|
|
11
11
|
* natywny silnik CSS.
|
|
12
12
|
*
|
|
13
13
|
* Wymaga arkusza `@konce-pt/grid` (`import '@konce-pt/grid';`).
|
package/dist/grid/layout.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export type KptLayoutValue = number | string | undefined;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function layoutStyle(vars: Readonly<Record<string, KptLayoutValue>>, style: CSSProperties | undefined): CSSProperties;
|
|
12
12
|
/**
|
|
13
|
-
* Renderuje element układu albo
|
|
13
|
+
* Renderuje element układu albo - w trybie `asChild` - oddaje propsy jedynemu dziecku.
|
|
14
14
|
*
|
|
15
|
-
* To reactowy odpowiednik dyrektywy: `<KptCol asChild><li
|
|
15
|
+
* To reactowy odpowiednik dyrektywy: `<KptCol asChild><li>...</li></KptCol>` nie dokłada żadnego
|
|
16
16
|
* elementu do DOM, dokładnie jak `<li kptCol="6">` w Angularze.
|
|
17
17
|
*/
|
|
18
18
|
export declare function renderLayout(asChild: boolean, children: ReactNode, props: Record<string, unknown>, element: 'div' | 'span'): ReactElement;
|
package/dist/grid/layout.js
CHANGED
|
@@ -17,9 +17,9 @@ export function layoutStyle(vars, style) {
|
|
|
17
17
|
return { ...result, ...style };
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Renderuje element układu albo
|
|
20
|
+
* Renderuje element układu albo - w trybie `asChild` - oddaje propsy jedynemu dziecku.
|
|
21
21
|
*
|
|
22
|
-
* To reactowy odpowiednik dyrektywy: `<KptCol asChild><li
|
|
22
|
+
* To reactowy odpowiednik dyrektywy: `<KptCol asChild><li>...</li></KptCol>` nie dokłada żadnego
|
|
23
23
|
* elementu do DOM, dokładnie jak `<li kptCol="6">` w Angularze.
|
|
24
24
|
*/
|
|
25
25
|
export function renderLayout(asChild, children, props, element) {
|
package/dist/grid/llms.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# KptGrid / KptCol / KptFlex (@konce-pt/react/grid)
|
|
2
2
|
|
|
3
3
|
React ergonomics over the `@konce-pt/grid` stylesheet. The components set nothing but inline custom
|
|
4
|
-
properties
|
|
4
|
+
properties - they neither add nor remove classes, and the layout is computed by the native CSS
|
|
5
5
|
engine.
|
|
6
6
|
|
|
7
7
|
Import: `import { KptGrid, KptCol, KptFlex } from '@konce-pt/react/grid';`
|
|
@@ -11,7 +11,7 @@ Requires the stylesheet: `import '@konce-pt/grid';`
|
|
|
11
11
|
The Angular port ships `kptGrid` / `kptCol` / `kptFlex` as attribute directives, which add nothing
|
|
12
12
|
to the DOM. Here they are components, and `asChild` gives back the missing half: the props land on
|
|
13
13
|
the element you were rendering anyway, so a column can be an `<li>`, an `<article>` or another
|
|
14
|
-
component
|
|
14
|
+
component - no wrapper `<div>` in the middle of a grid.
|
|
15
15
|
|
|
16
16
|
## Breakpoints (mobile-first)
|
|
17
17
|
`sm` >= 640px, `md` >= 768px, `lg` >= 1024px, `xl` >= 1280px, `2xl` >= 1536px.
|
|
@@ -20,22 +20,22 @@ gives 12 on mobile, `sm` and `md`, and 5 only from `lg` up.
|
|
|
20
20
|
|
|
21
21
|
## KptGrid
|
|
22
22
|
Class `kpt-grid`. Renders a `<div>`, or the child with `asChild`.
|
|
23
|
-
- `columns`: number
|
|
23
|
+
- `columns`: number - the column count (12 by default, from CSS). Variants: `columnsSm`,
|
|
24
24
|
`columnsMd`, `columnsLg`, `columnsXl`, `columns2xl`
|
|
25
|
-
- `gap`: string
|
|
26
|
-
- `gapX`, `gapY`: string
|
|
27
|
-
- `container`: boolean
|
|
25
|
+
- `gap`: string - the gap on both axes, e.g. `'1.5rem'`, `'var(--kpt-space-6)'`
|
|
26
|
+
- `gapX`, `gapY`: string - the gap on one axis, overriding `gap`
|
|
27
|
+
- `container`: boolean - container query mode (see below)
|
|
28
28
|
- `className`, `style`, `ref` and every other `<div>` prop pass through; your `style` wins over the
|
|
29
29
|
generated variables
|
|
30
30
|
|
|
31
31
|
## KptCol
|
|
32
|
-
No class of its own
|
|
33
|
-
- `span`: number | string
|
|
34
|
-
- `spanSm`, `spanMd`, `spanLg`, `spanXl`, `span2xl`
|
|
35
|
-
- `start`: number
|
|
36
|
-
- `order`: number
|
|
32
|
+
No class of its own - only the variables.
|
|
33
|
+
- `span`: number | string - the span, the mobile-first base; `'full'` means the whole width
|
|
34
|
+
- `spanSm`, `spanMd`, `spanLg`, `spanXl`, `span2xl` - per-breakpoint overrides
|
|
35
|
+
- `start`: number - the grid line the column starts at (1-based); this is how offsets are done
|
|
36
|
+
- `order`: number - the visual order. It does not change the DOM: screen readers and keyboard
|
|
37
37
|
navigation follow the DOM, so do not use it to move interactive content around
|
|
38
|
-
- `self`: string
|
|
38
|
+
- `self`: string - `align-self` (`start`, `end`, `center`, `stretch`, `baseline`)
|
|
39
39
|
|
|
40
40
|
## KptFlex
|
|
41
41
|
Class `kpt-flex`. The same variables and breakpoints as the grid, in one dimension.
|
|
@@ -51,11 +51,11 @@ Values with no matching prop are supplied with utility classes from `@konce-pt/g
|
|
|
51
51
|
|
|
52
52
|
## An undefined prop sets nothing
|
|
53
53
|
A variable is written only when its prop has a value. Writing `--kpt-col: undefined` would override
|
|
54
|
-
what a utility class or the stylesheet already provides, so the components skip it entirely
|
|
54
|
+
what a utility class or the stylesheet already provides, so the components skip it entirely - the
|
|
55
55
|
same rule as the `?? null` in the Angular directives.
|
|
56
56
|
|
|
57
57
|
## Container mode (`container`)
|
|
58
|
-
The children's spans react to the width of THIS grid instead of the window
|
|
58
|
+
The children's spans react to the width of THIS grid instead of the window - a card in a narrow
|
|
59
59
|
sidebar lays itself out in a single column even though the viewport is wide.
|
|
60
60
|
|
|
61
61
|
A CSS limitation, not a package one: `@container` queries the nearest ancestor container, so an
|
|
@@ -107,4 +107,4 @@ The grid: `--kpt-grid-columns`, `--kpt-gap`, `--kpt-gap-x`, `--kpt-gap-y`, `--kp
|
|
|
107
107
|
`--kpt-align`, `--kpt-content`, `--kpt-flex-direction`, `--kpt-flex-wrap`.
|
|
108
108
|
The child: `--kpt-col`, `--kpt-col-start`, `--kpt-order`, `--kpt-self`, `--kpt-flex`, `--kpt-grow`,
|
|
109
109
|
`--kpt-shrink`.
|
|
110
|
-
Each one has per-breakpoint variants: `--kpt-col`
|
|
110
|
+
Each one has per-breakpoint variants: `--kpt-col` -> `--kpt-col-md`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @konce-pt/react/grid
|
|
2
|
+
* @konce-pt/react/grid - ergonomia Reacta nad arkuszem `@konce-pt/grid`.
|
|
3
3
|
* Komponenty ustawiają wyłącznie custom properties inline; układ liczy natywny CSS.
|
|
4
4
|
* Osobny subpath, bo arkusz układu jest opcjonalny i nie każda aplikacja go ładuje.
|
|
5
5
|
*/
|
|
@@ -3,7 +3,7 @@ import { type DeepPartial, type KptLocale, type KptMessageKey, type KptMessages
|
|
|
3
3
|
export interface KptI18nContextValue {
|
|
4
4
|
/** Bieżący język. */
|
|
5
5
|
locale: KptLocale;
|
|
6
|
-
/** Zmiana języka w runtime
|
|
6
|
+
/** Zmiana języka w runtime - działa tylko w obrębie `KptI18nProvider`. */
|
|
7
7
|
setLocale: (locale: KptLocale) => void;
|
|
8
8
|
/** Aktywny słownik. */
|
|
9
9
|
messages: KptMessages;
|
|
@@ -25,7 +25,7 @@ export interface KptI18nProviderProps {
|
|
|
25
25
|
children?: ReactNode;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Dostarcza tłumaczenia poddrzewu. Bez providera komponenty działają na EN
|
|
28
|
+
* Dostarcza tłumaczenia poddrzewu. Bez providera komponenty działają na EN -
|
|
29
29
|
* brak konfiguracji nigdy nie jest błędem.
|
|
30
30
|
*/
|
|
31
31
|
export declare function KptI18nProvider({ locale, messages, children }: Readonly<KptI18nProviderProps>): import("react").JSX.Element;
|
|
@@ -40,6 +40,6 @@ export interface KptI18nOverrides {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Tłumaczenia dla pojedynczego komponentu. `locale` i `dictionary` z propsów mają
|
|
43
|
-
* priorytet nad kontekstem
|
|
43
|
+
* priorytet nad kontekstem - tak samo jak inputy etykiet biją słownik w Angularze.
|
|
44
44
|
*/
|
|
45
45
|
export declare function useKptMessages(overrides?: KptI18nOverrides): KptI18nContextValue;
|
|
@@ -5,21 +5,21 @@ import { KPT_MESSAGES_EN, KPT_MESSAGES_PL, deepMerge, translate, } from '@konce-
|
|
|
5
5
|
import { isDevBuild } from "../internal/dev.js";
|
|
6
6
|
/*
|
|
7
7
|
* Wiązanie i18n dla Reacta. Odpowiednik `provideKptI18n` + `KptI18n` z Angulara,
|
|
8
|
-
* na tym samym rdzeniu z `@konce-pt/i18n`
|
|
9
|
-
* (słownik
|
|
8
|
+
* na tym samym rdzeniu z `@konce-pt/i18n` - te same klucze, ten sam fallback
|
|
9
|
+
* (słownik -> EN -> sam klucz) i ta sama interpolacja `{name}`.
|
|
10
10
|
*/
|
|
11
11
|
/** Kontrakt zwracany przez `useKptI18n()`. */
|
|
12
|
-
/** Klucze, o których brak już ostrzegaliśmy
|
|
12
|
+
/** Klucze, o których brak już ostrzegaliśmy - jedno ostrzeżenie na klucz. */
|
|
13
13
|
const warnedKeys = new Set();
|
|
14
14
|
/**
|
|
15
|
-
* `translate` z ostrzeżeniem w buildzie deweloperskim, gdy klucza nie ma w żadnym słowniku
|
|
15
|
+
* `translate` z ostrzeżeniem w buildzie deweloperskim, gdy klucza nie ma w żadnym słowniku -
|
|
16
16
|
* inaczej literówka daje po cichu sam klucz zamiast tekstu.
|
|
17
17
|
*/
|
|
18
18
|
function translateChecked(dict, key, params) {
|
|
19
19
|
const text = translate(dict, key, params);
|
|
20
20
|
if (text === key && isDevBuild() && !warnedKeys.has(key)) {
|
|
21
21
|
warnedKeys.add(key);
|
|
22
|
-
console.warn(`KptI18n: brak tłumaczenia dla klucza
|
|
22
|
+
console.warn(`KptI18n: brak tłumaczenia dla klucza "${key}".`);
|
|
23
23
|
}
|
|
24
24
|
return text;
|
|
25
25
|
}
|
|
@@ -32,7 +32,7 @@ const FALLBACK = {
|
|
|
32
32
|
};
|
|
33
33
|
const KptI18nContext = createContext(null);
|
|
34
34
|
/**
|
|
35
|
-
* Dostarcza tłumaczenia poddrzewu. Bez providera komponenty działają na EN
|
|
35
|
+
* Dostarcza tłumaczenia poddrzewu. Bez providera komponenty działają na EN -
|
|
36
36
|
* brak konfiguracji nigdy nie jest błędem.
|
|
37
37
|
*/
|
|
38
38
|
export function KptI18nProvider({ locale = 'en', messages, children }) {
|
|
@@ -66,7 +66,7 @@ export function useKptI18n() {
|
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Tłumaczenia dla pojedynczego komponentu. `locale` i `dictionary` z propsów mają
|
|
69
|
-
* priorytet nad kontekstem
|
|
69
|
+
* priorytet nad kontekstem - tak samo jak inputy etykiet biją słownik w Angularze.
|
|
70
70
|
*/
|
|
71
71
|
export function useKptMessages(overrides) {
|
|
72
72
|
const context = useKptI18n();
|
|
@@ -2,9 +2,9 @@ import { type KptIconInput } from '@konce-pt/icons';
|
|
|
2
2
|
/**
|
|
3
3
|
* Rejestruje (lub nadpisuje) ikony. Przyjmuje listę definicji z subpathu Tablera
|
|
4
4
|
* (`[Rocket, LayoutDashboard]`), obiekt definicji (np. `import * as tabler`) albo
|
|
5
|
-
* mapę `{ nazwa: 'inner svg' }`
|
|
5
|
+
* mapę `{ nazwa: 'inner svg' }` - patrz [[KptIconInput]].
|
|
6
6
|
*
|
|
7
|
-
* Treść jest sanityzowana do allowlisty geometrii SVG
|
|
7
|
+
* Treść jest sanityzowana do allowlisty geometrii SVG - mimo to `registerKptIcons()` wolno
|
|
8
8
|
* wołać wyłącznie z treścią kontrolowaną przez developera (build-time), nigdy bezpośrednio
|
|
9
9
|
* z danych runtime/CMS/uploadu bez własnej walidacji domenowej wyżej w stosie.
|
|
10
10
|
*/
|
|
@@ -13,7 +13,7 @@ export declare function registerKptIcons(next: KptIconInput): void;
|
|
|
13
13
|
export declare function getKptIcon(name: string): string | undefined;
|
|
14
14
|
/** Czy ikona o tej nazwie jest w rejestrze. */
|
|
15
15
|
export declare function hasKptIcon(name: string): boolean;
|
|
16
|
-
/** Subskrypcja zmian rejestru
|
|
16
|
+
/** Subskrypcja zmian rejestru - używana przez `KptIcon` przez `useSyncExternalStore`. */
|
|
17
17
|
export declare function subscribeKptIcons(listener: () => void): () => void;
|
|
18
18
|
/** Licznik rejestracji; rośnie po każdym `registerKptIcons`. */
|
|
19
19
|
export declare function getKptIconsVersion(): number;
|
|
@@ -10,9 +10,9 @@ let version = 0;
|
|
|
10
10
|
/**
|
|
11
11
|
* Rejestruje (lub nadpisuje) ikony. Przyjmuje listę definicji z subpathu Tablera
|
|
12
12
|
* (`[Rocket, LayoutDashboard]`), obiekt definicji (np. `import * as tabler`) albo
|
|
13
|
-
* mapę `{ nazwa: 'inner svg' }`
|
|
13
|
+
* mapę `{ nazwa: 'inner svg' }` - patrz [[KptIconInput]].
|
|
14
14
|
*
|
|
15
|
-
* Treść jest sanityzowana do allowlisty geometrii SVG
|
|
15
|
+
* Treść jest sanityzowana do allowlisty geometrii SVG - mimo to `registerKptIcons()` wolno
|
|
16
16
|
* wołać wyłącznie z treścią kontrolowaną przez developera (build-time), nigdy bezpośrednio
|
|
17
17
|
* z danych runtime/CMS/uploadu bez własnej walidacji domenowej wyżej w stosie.
|
|
18
18
|
*/
|
|
@@ -32,7 +32,7 @@ export function getKptIcon(name) {
|
|
|
32
32
|
export function hasKptIcon(name) {
|
|
33
33
|
return icons.has(name);
|
|
34
34
|
}
|
|
35
|
-
/** Subskrypcja zmian rejestru
|
|
35
|
+
/** Subskrypcja zmian rejestru - używana przez `KptIcon` przez `useSyncExternalStore`. */
|
|
36
36
|
export function subscribeKptIcons(listener) {
|
|
37
37
|
listeners.add(listener);
|
|
38
38
|
return () => {
|
package/dist/icon/icon.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ export interface KptIconProps extends ComponentPropsWithRef<'span'> {
|
|
|
4
4
|
name: string;
|
|
5
5
|
/** Rozmiar jako długość CSS (np. '1.25rem'); domyślnie dziedziczy z `font-size`. */
|
|
6
6
|
size?: string;
|
|
7
|
-
/** Nazwa dla czytnika ekranu
|
|
7
|
+
/** Nazwa dla czytnika ekranu - tylko gdy ikona niesie znaczenie bez tekstu obok. */
|
|
8
8
|
label?: string;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Ikona Koncept UI (inline SVG, zestaw Tabler Icons
|
|
12
|
-
* (1em) lub ustaw `size`; kolor z `currentColor`. Ikona musi być w rejestrze
|
|
11
|
+
* Ikona Koncept UI (inline SVG, zestaw Tabler Icons - MIT). Rozmiar dziedziczy z `font-size`
|
|
12
|
+
* (1em) lub ustaw `size`; kolor z `currentColor`. Ikona musi być w rejestrze - wbudowany
|
|
13
13
|
* zestaw działa od razu, pełny dodaje `registerKptTablerIcons()` z `@konce-pt/react/icons`.
|
|
14
14
|
*
|
|
15
15
|
* Domyślnie ikona jest dekoracją (`aria-hidden`). Ikona niosąca znaczenie sama, bez tekstu obok,
|
|
16
|
-
* dostaje `label`
|
|
16
|
+
* dostaje `label` - wtedy jest `role="img"` z tą nazwą. W buildzie deweloperskim nieznana nazwa
|
|
17
17
|
* daje jedno ostrzeżenie w konsoli zamiast cichej pustki.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
package/dist/icon/icon.js
CHANGED
|
@@ -5,15 +5,15 @@ import { useEffect, useSyncExternalStore } from 'react';
|
|
|
5
5
|
import { cn } from "../internal/cn.js";
|
|
6
6
|
import { isDevBuild } from "../internal/dev.js";
|
|
7
7
|
import { getKptIcon, getKptIconsVersion, subscribeKptIcons } from "./icon-registry.js";
|
|
8
|
-
/** Nazwy, o których już ostrzegliśmy
|
|
8
|
+
/** Nazwy, o których już ostrzegliśmy - jedno ostrzeżenie na nazwę, nie na każdą instancję. */
|
|
9
9
|
const warned = new Set();
|
|
10
10
|
/**
|
|
11
|
-
* Ikona Koncept UI (inline SVG, zestaw Tabler Icons
|
|
12
|
-
* (1em) lub ustaw `size`; kolor z `currentColor`. Ikona musi być w rejestrze
|
|
11
|
+
* Ikona Koncept UI (inline SVG, zestaw Tabler Icons - MIT). Rozmiar dziedziczy z `font-size`
|
|
12
|
+
* (1em) lub ustaw `size`; kolor z `currentColor`. Ikona musi być w rejestrze - wbudowany
|
|
13
13
|
* zestaw działa od razu, pełny dodaje `registerKptTablerIcons()` z `@konce-pt/react/icons`.
|
|
14
14
|
*
|
|
15
15
|
* Domyślnie ikona jest dekoracją (`aria-hidden`). Ikona niosąca znaczenie sama, bez tekstu obok,
|
|
16
|
-
* dostaje `label`
|
|
16
|
+
* dostaje `label` - wtedy jest `role="img"` z tą nazwą. W buildzie deweloperskim nieznana nazwa
|
|
17
17
|
* daje jedno ostrzeżenie w konsoli zamiast cichej pustki.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
@@ -24,7 +24,7 @@ export function KptIcon({ name, size = '', label = '', className, style, ...rest
|
|
|
24
24
|
// Rejestr bywa uzupełniany po pierwszym renderze (leniwy import zestawu Tabler),
|
|
25
25
|
// więc komponent słucha jego wersji zamiast czytać go raz.
|
|
26
26
|
useSyncExternalStore(subscribeKptIcons, getKptIconsVersion, getKptIconsVersion);
|
|
27
|
-
// Treść pochodzi z zaufanego rejestru i przeszła sanitizację przy rejestracji
|
|
27
|
+
// Treść pochodzi z zaufanego rejestru i przeszła sanitizację przy rejestracji -
|
|
28
28
|
// to ten sam kontrakt, co `innerHTML` w porcie Angulara.
|
|
29
29
|
const svg = getKptIcon(name);
|
|
30
30
|
const html = renderKptIconSvg(svg);
|
|
@@ -32,7 +32,7 @@ export function KptIcon({ name, size = '', label = '', className, style, ...rest
|
|
|
32
32
|
if (svg || !isDevBuild() || warned.has(name))
|
|
33
33
|
return;
|
|
34
34
|
warned.add(name);
|
|
35
|
-
console.warn(`KptIcon: ikony
|
|
35
|
+
console.warn(`KptIcon: ikony "${name}" nie ma (jeszcze) w rejestrze - sprawdź nazwę albo zarejestruj ją (registerKptIcons / registerKptTablerIcons).`);
|
|
36
36
|
}, [svg, name]);
|
|
37
37
|
return (_jsx("span", { className: cn('kpt-icon-host', className), "aria-hidden": label ? undefined : true, role: label ? 'img' : undefined, "aria-label": label || undefined, style: size ? { fontSize: size, ...style } : style,
|
|
38
38
|
// eslint-disable-next-line react/no-danger -- treść z rejestru, zsanityzowana przy `register()` (sanitizeSvgFragment)
|
package/dist/icon/llms.txt
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
# KptIcon (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
An inline SVG icon (Tabler Icons
|
|
3
|
+
An inline SVG icon (Tabler Icons - MIT). The size follows `font-size` (1em) or the `size` prop;
|
|
4
4
|
the colour comes from `currentColor`.
|
|
5
5
|
Import: `import { KptIcon } from '@konce-pt/react';`
|
|
6
6
|
|
|
7
7
|
## DOM
|
|
8
8
|
<span class="kpt-icon-host" aria-hidden="true">
|
|
9
|
-
<svg class="kpt-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
9
|
+
<svg class="kpt-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">...</svg>
|
|
10
10
|
</span>
|
|
11
11
|
|
|
12
12
|
## Props
|
|
13
|
-
- `name`: string
|
|
14
|
-
- `size`: string
|
|
15
|
-
- `label`: string
|
|
13
|
+
- `name`: string - the icon name from the registry (required)
|
|
14
|
+
- `size`: string - a CSS length (e.g. '1.25rem'); by default inherited from `font-size`
|
|
15
|
+
- `label`: string - a name for screen readers; with it the icon is `role="img"`, without it `aria-hidden`
|
|
16
16
|
- `className`, `ref` and every other `<span>` prop go to the host
|
|
17
17
|
|
|
18
18
|
## The registry
|
|
19
19
|
The built-in set (84 icons) works with no setup. It covers both what the library's own components
|
|
20
|
-
draw and the staples of an application shell
|
|
21
|
-
logout, layout-dashboard, home, activity, chart-bar, arrow-up-right, brand-github and the like
|
|
20
|
+
draw and the staples of an application shell - sun, moon, bell, settings, users, user-circle,
|
|
21
|
+
logout, layout-dashboard, home, activity, chart-bar, arrow-up-right, brand-github and the like -
|
|
22
22
|
so a typical admin panel never needs the full set.
|
|
23
23
|
|
|
24
24
|
The full Tabler set (5130 icons) is opt-in, and there are two paths. `@konce-pt/react/icons`
|
|
25
25
|
exposes every icon as its own export, so importing by name lets the bundler keep only what you
|
|
26
26
|
used:
|
|
27
27
|
|
|
28
|
-
// main.tsx
|
|
28
|
+
// main.tsx - production: two icons reach the bundle.
|
|
29
29
|
import { LayoutDashboard, Rocket } from '@konce-pt/react/icons';
|
|
30
30
|
import { registerKptIcons } from '@konce-pt/react';
|
|
31
31
|
|
|
32
32
|
registerKptIcons([LayoutDashboard, Rocket]);
|
|
33
33
|
|
|
34
|
-
// main.tsx
|
|
34
|
+
// main.tsx - prototype: every icon, about 1.2 MB.
|
|
35
35
|
import { registerKptTablerIcons } from '@konce-pt/react/icons';
|
|
36
36
|
|
|
37
37
|
registerKptTablerIcons();
|
|
38
38
|
|
|
39
39
|
`registerKptIcons` is the one that shrinks: it takes the data as an argument and imports nothing
|
|
40
40
|
from the Tabler subpath, so the bundle follows your imports. Passing the namespace object
|
|
41
|
-
(`import * as tabler`) registers everything
|
|
41
|
+
(`import * as tabler`) registers everything - a namespace handed to a function blocks static
|
|
42
42
|
analysis, so it is the explicit form of the prototype path, not a smaller one.
|
|
43
43
|
|
|
44
44
|
Export names are PascalCase because `kebab-case` is not a legal identifier and camelCase would
|
|
@@ -47,9 +47,9 @@ so `BrandHtml5` registers as `brand-html5`.
|
|
|
47
47
|
|
|
48
48
|
The registry is a module singleton, not a context: icons are global to the application, so there is
|
|
49
49
|
nothing to provide. `KptIcon` subscribes to it, so icons registered after the first render appear
|
|
50
|
-
without a manual refresh. Register your own with `registerKptIcons({ name: '<path
|
|
50
|
+
without a manual refresh. Register your own with `registerKptIcons({ name: '<path ... />' })`.
|
|
51
51
|
|
|
52
|
-
An unknown name renders an empty host rather than throwing
|
|
52
|
+
An unknown name renders an empty host rather than throwing - a missing icon never takes the page
|
|
53
53
|
down with it.
|
|
54
54
|
|
|
55
55
|
## Security
|
|
@@ -63,7 +63,7 @@ CMS, an API or an upload.
|
|
|
63
63
|
<KptButton><KptIcon name="phone" /> Call</KptButton>
|
|
64
64
|
|
|
65
65
|
## Accessibility
|
|
66
|
-
By default an icon is `aria-hidden`
|
|
66
|
+
By default an icon is `aria-hidden` - decorative, which is right next to a text label or inside
|
|
67
67
|
an icon button with its own name. An icon that carries meaning on its own gets `label`: it becomes
|
|
68
68
|
`role="img"` with that `aria-label`. In development builds an unknown name logs one console
|
|
69
69
|
warning per name instead of rendering silently empty.
|
|
@@ -7,13 +7,13 @@ export interface KptIconButtonProps extends ComponentPropsWithRef<'button'> {
|
|
|
7
7
|
shape?: 'round' | 'square';
|
|
8
8
|
/** Spinner zamiast ikony + zablokowana interakcja; ustawia `aria-busy`. */
|
|
9
9
|
loading?: boolean;
|
|
10
|
-
/** Etykieta dostępności
|
|
10
|
+
/** Etykieta dostępności - wymagana, bo przycisk nie ma tekstu. */
|
|
11
11
|
'aria-label': string;
|
|
12
12
|
/** Propsy wrappera hosta (`.kpt-icon-button-host`). */
|
|
13
13
|
hostProps?: KptHostProps<'span'>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Przycisk ikonowy (tylko ikona). `aria-label` jest wymagany typem
|
|
16
|
+
* Przycisk ikonowy (tylko ikona). `aria-label` jest wymagany typem - bez tekstu przycisk nie ma
|
|
17
17
|
* dostępnej nazwy, a to najczęstszy błąd dostępności w tej rodzinie komponentów.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
@@ -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
|
-
* Przycisk ikonowy (tylko ikona). `aria-label` jest wymagany typem
|
|
4
|
+
* Przycisk ikonowy (tylko ikona). `aria-label` jest wymagany typem - bez tekstu przycisk nie ma
|
|
5
5
|
* dostępnej nazwy, a to najczęstszy błąd dostępności w tej rodzinie komponentów.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
@@ -5,18 +5,18 @@ An icon-only button. Import: `import { KptIconButton } from '@konce-pt/react';`
|
|
|
5
5
|
## DOM
|
|
6
6
|
<span class="kpt-icon-button-host">
|
|
7
7
|
<button class="kpt-icon-button" type="button" data-variant="text" data-size="md" data-shape="round" aria-label="Settings">
|
|
8
|
-
|
|
8
|
+
...icon...
|
|
9
9
|
</button>
|
|
10
10
|
</span>
|
|
11
11
|
|
|
12
12
|
## Props
|
|
13
|
-
- `variant`: the same union as `KptButton`
|
|
13
|
+
- `variant`: the same union as `KptButton` - 'filled' | 'tonal' | 'outline' | 'text' | 'danger'
|
|
14
14
|
(default 'text')
|
|
15
15
|
- `size`: 'sm' | 'md' | 'lg' (default 'md')
|
|
16
16
|
- `shape`: 'round' | 'square' (default 'round')
|
|
17
|
-
- `loading`: boolean
|
|
18
|
-
- `aria-label`: string
|
|
19
|
-
- `hostProps`
|
|
17
|
+
- `loading`: boolean - a spinner instead of the icon, sets `aria-busy` and disables the button
|
|
18
|
+
- `aria-label`: string - REQUIRED by the type
|
|
19
|
+
- `hostProps` - props for the `.kpt-icon-button-host` wrapper
|
|
20
20
|
- `className`, `ref` and every other `<button>` prop go to the inner `<button>`
|
|
21
21
|
|
|
22
22
|
## The label is required by the type
|
|
@@ -29,6 +29,10 @@ without it, so the mistake cannot reach the browser.
|
|
|
29
29
|
<KptIconButton variant="filled" shape="square" aria-label="Delete"><KptIcon name="x" /></KptIconButton>
|
|
30
30
|
<KptIconButton loading aria-label="Saving" />
|
|
31
31
|
|
|
32
|
+
## Motion
|
|
33
|
+
Pressed, it squeezes slightly and springs back on release (shared mixin `styles/_press.scss`). The `loading` spinner pops in. 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
|
The same button tokens as `KptButton` (`--kpt-button-*` for each variant), plus the size and shape
|
|
34
38
|
geometry from the shared stylesheet.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * from '@konce-pt/icons/tabler';
|
|
2
2
|
/**
|
|
3
3
|
* Rejestruje pełny zestaw Tabler Icons (5130), dzięki czemu `KptIcon` może użyć dowolnej
|
|
4
|
-
* ikony po nazwie. Wywołaj raz, w wejściu aplikacji
|
|
4
|
+
* ikony po nazwie. Wywołaj raz, w wejściu aplikacji - rejestr jest globalny, więc nie ma
|
|
5
5
|
* potrzeby owijać drzewa żadnym providerem.
|
|
6
6
|
*
|
|
7
7
|
* Wciąga komplet (~1,2 MB), więc to ścieżka prototypowa. W produkcji zaimportuj ikony
|
|
8
|
-
* po nazwie i podaj je do `registerKptIcons([...])` z rdzenia `@konce-pt/react`
|
|
8
|
+
* po nazwie i podaj je do `registerKptIcons([...])` z rdzenia `@konce-pt/react` - ta funkcja
|
|
9
9
|
* nie importuje pełnego zestawu, więc bundler zostawia wyłącznie użyte ikony.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @konce-pt/react/icons
|
|
2
|
+
* @konce-pt/react/icons - pełny zestaw Tabler Icons (MIT) dla `KptIcon`.
|
|
3
3
|
* Opcjonalny (pobierany tylko przy imporcie), by nie powiększać rdzenia biblioteki.
|
|
4
4
|
*/
|
|
5
5
|
import { KPT_TABLER_ICONS } from '@konce-pt/icons/tabler';
|
|
@@ -9,11 +9,11 @@ import { registerKptIcons } from "../icon/icon-registry.js";
|
|
|
9
9
|
export * from '@konce-pt/icons/tabler';
|
|
10
10
|
/**
|
|
11
11
|
* Rejestruje pełny zestaw Tabler Icons (5130), dzięki czemu `KptIcon` może użyć dowolnej
|
|
12
|
-
* ikony po nazwie. Wywołaj raz, w wejściu aplikacji
|
|
12
|
+
* ikony po nazwie. Wywołaj raz, w wejściu aplikacji - rejestr jest globalny, więc nie ma
|
|
13
13
|
* potrzeby owijać drzewa żadnym providerem.
|
|
14
14
|
*
|
|
15
15
|
* Wciąga komplet (~1,2 MB), więc to ścieżka prototypowa. W produkcji zaimportuj ikony
|
|
16
|
-
* po nazwie i podaj je do `registerKptIcons([...])` z rdzenia `@konce-pt/react`
|
|
16
|
+
* po nazwie i podaj je do `registerKptIcons([...])` z rdzenia `@konce-pt/react` - ta funkcja
|
|
17
17
|
* nie importuje pełnego zestawu, więc bundler zostawia wyłącznie użyte ikony.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
package/dist/image/image.js
CHANGED
|
@@ -38,7 +38,7 @@ export function KptImage({ src, alt = '', width = null, preview = false, locale,
|
|
|
38
38
|
if (!preview) {
|
|
39
39
|
return (_jsx("div", { className: cn('kpt-image-host', className), ...rest, children: _jsx("div", { className: "kpt-image", style: style, children: _jsx("img", { className: "kpt-image__img", src: src, alt: alt }) }) }));
|
|
40
40
|
}
|
|
41
|
-
// `close` przychodzi z każdej drogi:
|
|
41
|
+
// `close` przychodzi z każdej drogi: `x`, `Escape`, tło.
|
|
42
42
|
const onClosed = () => {
|
|
43
43
|
setOpen(false);
|
|
44
44
|
triggerRef.current?.focus();
|
package/dist/image/llms.txt
CHANGED
|
@@ -8,26 +8,26 @@ Import: `import { KptImage } from '@konce-pt/react';`
|
|
|
8
8
|
<!-- with preview: -->
|
|
9
9
|
<button class="kpt-image kpt-image--preview" type="button" aria-haspopup="dialog"
|
|
10
10
|
aria-label="Show full size: Photo" style="width:240px">
|
|
11
|
-
<img class="kpt-image__img" src="
|
|
12
|
-
<span class="kpt-image__mask" aria-hidden="true"
|
|
11
|
+
<img class="kpt-image__img" src="..." alt="">
|
|
12
|
+
<span class="kpt-image__mask" aria-hidden="true">...zoom-in...</span>
|
|
13
13
|
</button>
|
|
14
14
|
<dialog class="kpt-image__overlay" aria-label="Photo">
|
|
15
|
-
<button class="kpt-image__close" type="button" aria-label="Close"
|
|
16
|
-
<img class="kpt-image__full" src="
|
|
15
|
+
<button class="kpt-image__close" type="button" aria-label="Close">...</button>
|
|
16
|
+
<img class="kpt-image__full" src="..." alt="Photo" loading="lazy">
|
|
17
17
|
</dialog>
|
|
18
|
-
<!-- without preview: <div class="kpt-image"><img class="kpt-image__img"
|
|
18
|
+
<!-- without preview: <div class="kpt-image"><img class="kpt-image__img" ...></div> -->
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
## Props
|
|
22
22
|
- `src`: string (required); `alt`: string
|
|
23
|
-
- `width`: string | null
|
|
24
|
-
- `preview`: boolean
|
|
23
|
+
- `width`: string | null - a CSS length, e.g. `'240px'`
|
|
24
|
+
- `preview`: boolean - the thumbnail becomes a button opening a modal preview
|
|
25
25
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
26
26
|
|
|
27
27
|
## The overlay closes around the photo, not on it
|
|
28
|
-
The dialog fills the viewport, so a click on the dialog element itself
|
|
29
|
-
|
|
30
|
-
it) does not dismiss it; Escape and
|
|
28
|
+
The dialog fills the viewport, so a click on the dialog element itself - not on the photo or the
|
|
29
|
+
x - is a click on the backdrop and closes the preview. Clicking the photo (to look closer, to drag
|
|
30
|
+
it) does not dismiss it; Escape and x are the explicit ways out.
|
|
31
31
|
|
|
32
32
|
## The mask is decorative
|
|
33
33
|
The zoom-in overlay is `aria-hidden`: it repeats what the cursor (`zoom-in`) already says and would
|
|
@@ -41,13 +41,13 @@ only add noise for a screen reader.
|
|
|
41
41
|
The thumbnail is named from `image.previewOf` (`{alt}`) or `image.preview`; the close button from `common.close`.
|
|
42
42
|
|
|
43
43
|
## Tokens
|
|
44
|
-
The radius `--kpt-radius-md`; the backdrop and the hover mask `--kpt-color-overlay-scrim`; the
|
|
44
|
+
The radius `--kpt-radius-md`; the backdrop and the hover mask `--kpt-color-overlay-scrim`; the x button and the magnifier disc `--kpt-color-surface` / `--kpt-color-on-surface` with `--kpt-elevation-2`.
|
|
45
45
|
|
|
46
46
|
## Accessibility
|
|
47
|
-
With `preview`, the thumbnail is a `<button aria-haspopup="dialog">` named
|
|
47
|
+
With `preview`, the thumbnail is a `<button aria-haspopup="dialog">` named "Show full size: <alt>"
|
|
48
48
|
(`image.previewOf`, or `image.preview` without `alt`), so it is reached with Tab and opened with
|
|
49
49
|
Enter or Space; the magnifier shows on hover and on `:focus-visible`. The preview is a native modal
|
|
50
|
-
`<dialog>` opened with `showModal()` and named by `alt`: focus moves to its
|
|
50
|
+
`<dialog>` opened with `showModal()` and named by `alt`: focus moves to its x button and stays inside,
|
|
51
51
|
Escape closes it, the page behind is inert, document scrolling is locked while it is open, and focus
|
|
52
52
|
returns to the thumbnail. It sits in the top layer, so no ancestor with `transform` or
|
|
53
53
|
`overflow: hidden` can clip it.
|
package/dist/input/input.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { KptSpeechMode } from '@konce-pt/speech';
|
|
3
|
+
import { type KptSpeechColor } from '../speech/speech-button.tsx';
|
|
2
4
|
import type { KptHostProps } from '../internal/types.ts';
|
|
3
5
|
export type KptInputType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' | 'time';
|
|
4
6
|
export interface KptInputProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'required'> {
|
|
@@ -14,20 +16,31 @@ export interface KptInputProps extends Omit<ComponentPropsWithRef<'input'>, 'typ
|
|
|
14
16
|
/**
|
|
15
17
|
* Czy pole było dotknięte. Pominięty = stan błędu pokazuje się od razu po `invalid`,
|
|
16
18
|
* bo w Reakcie to zwykle biblioteka formularza decyduje, kiedy błąd jest gotowy.
|
|
17
|
-
* Podaj go, gdy chcesz bramkę
|
|
19
|
+
* Podaj go, gdy chcesz bramkę "dopiero po dotknięciu" znaną z portu Angulara.
|
|
18
20
|
*/
|
|
19
21
|
touched?: boolean;
|
|
20
|
-
/** Wygodniejszy odpowiednik `onChange`
|
|
22
|
+
/** Wygodniejszy odpowiednik `onChange` - dostaje samą wartość. */
|
|
21
23
|
onValueChange?: (value: string) => void;
|
|
22
|
-
/** Wywoływane na `blur`
|
|
24
|
+
/** Wywoływane na `blur` - moment, w którym pole staje się dotknięte. */
|
|
23
25
|
onTouch?: () => void;
|
|
24
26
|
/** Propsy wrappera hosta (`.kpt-input-host`). `className` i `ref` idą na `<input>`. */
|
|
25
27
|
hostProps?: KptHostProps<'span'>;
|
|
28
|
+
/** Mikrofon na końcu pola (Web Speech API). Bez wsparcia przeglądarki się nie pokazuje. */
|
|
29
|
+
speech?: boolean;
|
|
30
|
+
/** Język dyktowania (BCP 47); bez niego z `KptI18nProvider`. */
|
|
31
|
+
speechLang?: string;
|
|
32
|
+
/** Kolor "stop" i fali w trakcie nasłuchu; domyślnie kolor motywu. */
|
|
33
|
+
speechColor?: KptSpeechColor;
|
|
34
|
+
/**
|
|
35
|
+
* `insert` (domyślnie, w kursor), `append` albo `replace` - pole czyści się w chwili kliknięcia
|
|
36
|
+
* mikrofonu, a dyktowanie kończy się po jednej wypowiedzi (wzorzec wyszukiwarki).
|
|
37
|
+
*/
|
|
38
|
+
speechMode?: KptSpeechMode;
|
|
26
39
|
}
|
|
27
40
|
/**
|
|
28
41
|
* Pole tekstowe Koncept UI. Renderuje natywny `<input>` w hoście `.kpt-input-host`.
|
|
29
42
|
*
|
|
30
|
-
* Działa kontrolowane (`value` + `onValueChange`) i niekontrolowane (`defaultValue`)
|
|
43
|
+
* Działa kontrolowane (`value` + `onValueChange`) i niekontrolowane (`defaultValue`) -
|
|
31
44
|
* w drugim trybie wartość należy do DOM, więc natywny `<form>`, `<form action>`, reset
|
|
32
45
|
* formularza i React Hook Form (`register`) działają bez adaptera.
|
|
33
46
|
*
|
|
@@ -38,4 +51,4 @@ export interface KptInputProps extends Omit<ComponentPropsWithRef<'input'>, 'typ
|
|
|
38
51
|
* <KptInput name="email" type="email" defaultValue="" />
|
|
39
52
|
* <KptInput value={email} onValueChange={setEmail} invalid={!ok} touched={blurred} />
|
|
40
53
|
*/
|
|
41
|
-
export declare function KptInput({ type, required, invalid, touched, onValueChange, onTouch, hostProps, className, id, onChange, onBlur, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, ...rest }: Readonly<KptInputProps>): import("react").JSX.Element;
|
|
54
|
+
export declare function KptInput({ type, required, invalid, touched, onValueChange, onTouch, hostProps, className, id, onChange, onBlur, ref, speech, speechLang, speechColor, speechMode, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, ...rest }: Readonly<KptInputProps>): import("react").JSX.Element;
|