@eifi1/ui-kit 0.10.0 → 0.12.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 +66 -37
- package/dist/chart.d.ts +3 -1
- package/dist/chart.js +2 -0
- package/dist/chart.js.map +1 -1
- package/dist/components/account-settings-labels.d.ts +105 -0
- package/dist/components/account-settings-labels.js +81 -0
- package/dist/components/account-settings-labels.js.map +1 -0
- package/dist/components/account-settings.d.ts +36 -52
- package/dist/components/account-settings.js +44 -8
- package/dist/components/account-settings.js.map +1 -1
- package/dist/components/alert-banner.d.ts +26 -1
- package/dist/components/alert-banner.js +10 -7
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +26 -4
- package/dist/components/amount-input.js +5 -2
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/authed-image.d.ts +68 -0
- package/dist/components/authed-image.js +117 -0
- package/dist/components/authed-image.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +2 -1
- package/dist/components/breadcrumbs.js +5 -2
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/bulk-action-bar.d.ts +51 -5
- package/dist/components/bulk-action-bar.js +88 -41
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.d.ts +107 -3
- package/dist/components/button-group.js +60 -5
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/calculator.d.ts +17 -4
- package/dist/components/calendar-heatmap.d.ts +162 -0
- package/dist/components/calendar-heatmap.js +336 -0
- package/dist/components/calendar-heatmap.js.map +1 -0
- package/dist/components/chip.d.ts +2 -1
- package/dist/components/chip.js +6 -3
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.d.ts +66 -2
- package/dist/components/choice-card.js +108 -1
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/combobox-core.js +2 -0
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.d.ts +2 -2
- package/dist/components/combobox.js +31 -9
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/copy-button.d.ts +52 -70
- package/dist/components/copy-button.js +1 -1
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table-cells.d.ts +63 -0
- package/dist/components/data-table-cells.js +64 -0
- package/dist/components/data-table-cells.js.map +1 -0
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table-filters.js +31 -1
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-labels.d.ts +13 -0
- package/dist/components/data-table-labels.js +8 -1
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +104 -12
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +3 -1
- package/dist/components/date-picker.js +15 -2
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/description-list.d.ts +23 -3
- package/dist/components/description-list.js +23 -3
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +1 -0
- package/dist/components/entity-combobox.d.ts +1 -1
- package/dist/components/entity-combobox.js +18 -3
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/error-boundary.d.ts +92 -0
- package/dist/components/error-boundary.js +111 -0
- package/dist/components/error-boundary.js.map +1 -0
- package/dist/components/field.d.ts +69 -0
- package/dist/components/field.js +75 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-button.d.ts +51 -208
- package/dist/components/file-dropzone.d.ts +50 -2
- package/dist/components/floating-panel.d.ts +156 -4
- package/dist/components/floating-panel.js +193 -29
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/form-actions.d.ts +53 -0
- package/dist/components/form-actions.js +98 -0
- package/dist/components/form-actions.js.map +1 -0
- package/dist/components/image-grid.d.ts +67 -0
- package/dist/components/image-grid.js +112 -0
- package/dist/components/image-grid.js.map +1 -0
- package/dist/components/lightbox.d.ts +104 -0
- package/dist/components/lightbox.js +229 -0
- package/dist/components/lightbox.js.map +1 -0
- package/dist/components/line-items.d.ts +114 -0
- package/dist/components/line-items.js +238 -0
- package/dist/components/line-items.js.map +1 -0
- package/dist/components/list.d.ts +37 -3
- package/dist/components/list.js +39 -14
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-state.d.ts +24 -0
- package/dist/components/loading-state.js +32 -0
- package/dist/components/loading-state.js.map +1 -0
- package/dist/components/menu-item.d.ts +13 -2
- package/dist/components/menu-item.js +11 -2
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/mini-calendar.d.ts +82 -5
- package/dist/components/mini-calendar.js +212 -64
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +20 -1
- package/dist/components/modal.js +26 -2
- package/dist/components/modal.js.map +1 -1
- package/dist/components/month-picker.d.ts +21 -1
- package/dist/components/month-picker.js +139 -26
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.d.ts +1 -1
- package/dist/components/multi-entity-combobox.js +19 -3
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/nav-pills.d.ts +67 -0
- package/dist/components/nav-pills.js +69 -0
- package/dist/components/nav-pills.js.map +1 -0
- package/dist/components/number-field.d.ts +26 -5
- package/dist/components/number-field.js +5 -7
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.d.ts +27 -5
- package/dist/components/number-input.js +7 -1
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.d.ts +17 -4
- package/dist/components/passkeys-setting.d.ts +67 -0
- package/dist/components/passkeys-setting.js +214 -0
- package/dist/components/passkeys-setting.js.map +1 -0
- package/dist/components/picker-sheet.js +2 -1
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/pie-chart-labels.d.ts +20 -0
- package/dist/components/pie-chart-labels.js +12 -0
- package/dist/components/pie-chart-labels.js.map +1 -0
- package/dist/components/pie-chart.d.ts +101 -0
- package/dist/components/pie-chart.js +283 -0
- package/dist/components/pie-chart.js.map +1 -0
- package/dist/components/progress-bar.d.ts +73 -3
- package/dist/components/progress-bar.js +110 -8
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/qr-code.d.ts +34 -0
- package/dist/components/qr-code.js +57 -0
- package/dist/components/qr-code.js.map +1 -0
- package/dist/components/search-field.d.ts +15 -3
- package/dist/components/search-field.js +5 -1
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/series-chart.d.ts +16 -0
- package/dist/components/series-chart.js +4 -1
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.d.ts +50 -1
- package/dist/components/signed-amount.d.ts +121 -0
- package/dist/components/signed-amount.js +152 -0
- package/dist/components/signed-amount.js.map +1 -0
- package/dist/components/skeleton.d.ts +10 -3
- package/dist/components/skeleton.js +12 -2
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/stat-tile.d.ts +2 -1
- package/dist/components/stat-tile.js +5 -2
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/status-dot.d.ts +6 -2
- package/dist/components/status-dot.js +6 -1
- package/dist/components/status-dot.js.map +1 -1
- package/dist/components/table.d.ts +77 -11
- package/dist/components/table.js +85 -17
- package/dist/components/table.js.map +1 -1
- package/dist/components/text-link.d.ts +176 -0
- package/dist/components/text-link.js +109 -0
- package/dist/components/text-link.js.map +1 -0
- package/dist/components/text.d.ts +8 -1
- package/dist/components/text.js +1 -0
- package/dist/components/text.js.map +1 -1
- package/dist/components/time-input.d.ts +50 -1
- package/dist/components/toggle-group.d.ts +28 -0
- package/dist/components/toggle-group.js +58 -9
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.d.ts +36 -3
- package/dist/components/toggle-legend.js +49 -0
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/tooltip.d.ts +11 -3
- package/dist/components/tooltip.js +2 -0
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/ui.d.ts +52 -729
- package/dist/components/ui.js +296 -27
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +3 -52
- package/dist/components/use-table-state.js +128 -30
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.d.ts +25 -3
- package/dist/components/user-avatar.js +32 -3
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/{data-table-filters-Dh9uF_S-.d.ts → data-table-Drun8Fk9.d.ts} +305 -61
- package/dist/data-table.d.ts +2 -1
- package/dist/data-table.js +5 -1
- package/dist/data-table.js.map +1 -1
- package/dist/feedback/feedback-dialog.d.ts +26 -3
- package/dist/feedback/feedback-dialog.js +16 -2
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +133 -0
- package/dist/feedback/feedback-thread.js +237 -0
- package/dist/feedback/feedback-thread.js.map +1 -0
- package/dist/feedback.d.ts +2 -1
- package/dist/feedback.js +1 -0
- package/dist/feedback.js.map +1 -1
- package/dist/hooks/use-authed-src.d.ts +71 -0
- package/dist/hooks/use-authed-src.js +63 -0
- package/dist/hooks/use-authed-src.js.map +1 -0
- package/dist/hooks/use-file-drop.d.ts +50 -2
- package/dist/hooks/use-hotkey.d.ts +59 -0
- package/dist/hooks/use-hotkey.js +105 -0
- package/dist/hooks/use-hotkey.js.map +1 -0
- package/dist/hooks/use-search-param-state.d.ts +83 -0
- package/dist/hooks/use-search-param-state.js +94 -0
- package/dist/hooks/use-search-param-state.js.map +1 -0
- package/dist/i18n/defaults.d.ts +17 -4
- package/dist/i18n/defaults.js +33 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +47 -310
- package/dist/i18n/kit-labels.js +20 -5
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +17 -4
- package/dist/i18n/locales/de-CH.d.ts +17 -4
- package/dist/i18n/locales/de-informal.d.ts +17 -4
- package/dist/i18n/locales/de.d.ts +17 -4
- package/dist/i18n/locales/de.js +165 -4
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +17 -4
- package/dist/i18n/locales/es.js +162 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +17 -4
- package/dist/i18n/locales/fr.js +162 -4
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +17 -4
- package/dist/i18n/locales/hu.js +162 -4
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +17 -4
- package/dist/i18n/locales/it.js +162 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +17 -4
- package/dist/i18n/locales/zh.js +162 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.d.ts +45 -21
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/kit-labels-v3biUF1L.d.ts +1645 -0
- package/dist/lib/clipping.d.ts +21 -5
- package/dist/lib/clipping.js +3 -0
- package/dist/lib/clipping.js.map +1 -1
- package/dist/lib/dates.d.ts +17 -1
- package/dist/lib/dates.js +19 -0
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/format.d.ts +144 -0
- package/dist/lib/format.js +149 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/qr-encode.d.ts +44 -0
- package/dist/lib/qr-encode.js +338 -0
- package/dist/lib/qr-encode.js.map +1 -0
- package/dist/rhf/fields.d.ts +241 -0
- package/dist/rhf/fields.js +601 -0
- package/dist/rhf/fields.js.map +1 -0
- package/dist/rhf/form.d.ts +50 -1
- package/dist/rhf/line-items.d.ts +31 -0
- package/dist/rhf/line-items.js +59 -0
- package/dist/rhf/line-items.js.map +1 -0
- package/dist/rhf/use-rhf-wizard-step.d.ts +22 -0
- package/dist/rhf/use-rhf-wizard-step.js +38 -0
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -0
- package/dist/rhf.d.ts +63 -1
- package/dist/rhf.js +3 -0
- package/dist/rhf.js.map +1 -1
- package/dist/shell/app-shell.d.ts +99 -2
- package/dist/shell/app-shell.js +58 -3
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/auth-layout.d.ts +74 -0
- package/dist/shell/auth-layout.js +97 -0
- package/dist/shell/auth-layout.js.map +1 -0
- package/dist/shell/top-bar-brand.d.ts +81 -0
- package/dist/shell/top-bar-brand.js +47 -0
- package/dist/shell/top-bar-brand.js.map +1 -0
- package/dist/shell/topbar-action-menu.d.ts +84 -3
- package/dist/shell/topbar-action-menu.js +115 -27
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell.d.ts +58 -2
- package/dist/shell.js +2 -0
- package/dist/shell.js.map +1 -1
- package/dist/wizard/stepper-nav.d.ts +49 -1
- package/dist/wizard/wizard-context.d.ts +30 -1
- package/dist/wizard/wizard-context.js +23 -2
- package/dist/wizard/wizard-context.js.map +1 -1
- package/dist/wizard/wizard-step.d.ts +20 -5
- package/dist/wizard/wizard-step.js +16 -3
- package/dist/wizard/wizard-step.js.map +1 -1
- package/dist/wizard.d.ts +51 -3
- package/package.json +1 -1
- package/src/chart.ts +4 -0
- package/src/components/account-settings-labels.ts +190 -0
- package/src/components/account-settings.tsx +110 -63
- package/src/components/alert-banner.tsx +36 -7
- package/src/components/amount-input.tsx +13 -1
- package/src/components/authed-image.tsx +190 -0
- package/src/components/breadcrumbs.tsx +8 -2
- package/src/components/bulk-action-bar.tsx +163 -57
- package/src/components/button-group.tsx +129 -4
- package/src/components/calendar-heatmap.tsx +599 -0
- package/src/components/chip.tsx +8 -4
- package/src/components/choice-card.tsx +208 -1
- package/src/components/combobox-core.tsx +5 -0
- package/src/components/combobox.tsx +31 -9
- package/src/components/copy-button.tsx +3 -2
- package/src/components/data-table-cells.tsx +119 -0
- package/src/components/data-table-filters.ts +77 -0
- package/src/components/data-table-labels.ts +23 -0
- package/src/components/data-table.tsx +231 -13
- package/src/components/date-picker.tsx +19 -3
- package/src/components/description-list.tsx +52 -3
- package/src/components/entity-combobox.tsx +18 -3
- package/src/components/error-boundary.tsx +216 -0
- package/src/components/field.tsx +188 -0
- package/src/components/floating-panel.tsx +380 -16
- package/src/components/form-actions.tsx +191 -0
- package/src/components/image-grid.tsx +181 -0
- package/src/components/lightbox.tsx +374 -0
- package/src/components/line-items.tsx +385 -0
- package/src/components/list.tsx +93 -18
- package/src/components/loading-state.tsx +47 -0
- package/src/components/menu-item.tsx +29 -3
- package/src/components/mini-calendar.tsx +317 -57
- package/src/components/modal.tsx +61 -3
- package/src/components/month-picker.tsx +181 -26
- package/src/components/multi-entity-combobox.tsx +19 -3
- package/src/components/nav-pills.tsx +152 -0
- package/src/components/number-field.tsx +15 -10
- package/src/components/number-input.tsx +16 -1
- package/src/components/passkeys-setting.tsx +331 -0
- package/src/components/picker-sheet.tsx +7 -1
- package/src/components/pie-chart-labels.ts +32 -0
- package/src/components/pie-chart.tsx +479 -0
- package/src/components/progress-bar.tsx +241 -13
- package/src/components/qr-code.tsx +83 -0
- package/src/components/search-field.tsx +20 -4
- package/src/components/series-chart.tsx +21 -0
- package/src/components/signed-amount.tsx +286 -0
- package/src/components/skeleton.tsx +21 -3
- package/src/components/stat-tile.tsx +8 -2
- package/src/components/status-dot.tsx +10 -2
- package/src/components/table.tsx +186 -23
- package/src/components/text-link.tsx +248 -0
- package/src/components/text.tsx +9 -1
- package/src/components/toggle-group.tsx +106 -13
- package/src/components/toggle-legend.tsx +87 -2
- package/src/components/tooltip.tsx +17 -3
- package/src/components/ui.tsx +572 -44
- package/src/components/use-table-state.ts +265 -33
- package/src/components/user-avatar.tsx +57 -3
- package/src/data-table.ts +10 -0
- package/src/feedback/feedback-dialog.tsx +42 -3
- package/src/feedback/feedback-thread.tsx +434 -0
- package/src/feedback.ts +1 -0
- package/src/hooks/use-authed-src.ts +161 -0
- package/src/hooks/use-hotkey.ts +172 -0
- package/src/hooks/use-search-param-state.ts +187 -0
- package/src/i18n/defaults.ts +32 -0
- package/src/i18n/kit-labels.tsx +104 -8
- package/src/i18n/locales/de.ts +162 -0
- package/src/i18n/locales/es.ts +159 -0
- package/src/i18n/locales/fr.ts +162 -0
- package/src/i18n/locales/hu.ts +160 -0
- package/src/i18n/locales/it.ts +160 -0
- package/src/i18n/locales/zh.ts +159 -0
- package/src/index.ts +64 -0
- package/src/lib/clipping.ts +22 -4
- package/src/lib/dates.ts +37 -0
- package/src/lib/format.ts +325 -0
- package/src/lib/qr-encode.ts +420 -0
- package/src/rhf/fields.tsx +1054 -0
- package/src/rhf/line-items.tsx +130 -0
- package/src/rhf/use-rhf-wizard-step.ts +113 -0
- package/src/rhf.ts +8 -0
- package/src/shell/app-shell.tsx +147 -2
- package/src/shell/auth-layout.tsx +190 -0
- package/src/shell/top-bar-brand.tsx +76 -0
- package/src/shell/topbar-action-menu.tsx +260 -49
- package/src/shell.ts +2 -0
- package/src/wizard/wizard-context.tsx +50 -1
- package/src/wizard/wizard-step.tsx +43 -6
- package/tokens.css +12 -0
|
@@ -1,210 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
import 'react';
|
|
2
|
+
export { M as DEFAULT_FILE_PICKER_LABELS, aa as FileButton, ab as FileButtonProps, b8 as FilePickHandler, ad as FilePickerLabels, ae as FileRejection, af as FileRejectionReason, ag as FileScreenOptions, aW as UseFilePickerOptions, aX as UseFilePickerReturn, b9 as formatAccept, ba as judgePick, a_ as matchesAccept, bb as screenFiles, bc as summariseRejections, b1 as useFilePicker } from '../kit-labels-v3biUF1L.js';
|
|
3
|
+
import './data-table-labels.js';
|
|
4
|
+
import './mini-calendar.js';
|
|
5
|
+
import './calendar-heatmap.js';
|
|
6
|
+
import './popover.js';
|
|
7
|
+
import './chip.js';
|
|
8
|
+
import 'lucide-react';
|
|
9
|
+
import './field-sync.js';
|
|
4
10
|
import './tooltip.js';
|
|
5
11
|
import '../hooks/use-anchored-rect.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
rejectedInvalid: (name: string) => string;
|
|
49
|
-
/** Spoken instead of the per-file message when more than one file was refused. */
|
|
50
|
-
rejectedMany: (count: number) => string;
|
|
51
|
-
/** Spoken (and shown, on a dropzone) when `onPick` refused the WHOLE pick.
|
|
52
|
-
* Receives the number of files in it. */
|
|
53
|
-
rejectedPick: (count: number) => string;
|
|
54
|
-
/** Spoken after a pick the component itself echoes (the dropzone). */
|
|
55
|
-
selected: (count: number, firstName: string) => string;
|
|
56
|
-
/** The dropzone's remove button for one file. */
|
|
57
|
-
remove: (name: string) => string;
|
|
58
|
-
/** The dropzone's remove-everything button in `multiple` mode. */
|
|
59
|
-
clearAll: string;
|
|
60
|
-
/** Spoken after a remove / clear, since the button that was pressed is gone. */
|
|
61
|
-
removed: (name: string) => string;
|
|
62
|
-
cleared: string;
|
|
63
|
-
/** The dropzone's accessible name, when the host passes no `dropLabel`. */
|
|
64
|
-
dropzone: string;
|
|
65
|
-
/** The dropzone's Browse button, when the host passes no `browseLabel`. */
|
|
66
|
-
browse: string;
|
|
67
|
-
/** What an empty single-file dropzone says (no `emptyLabel` given). */
|
|
68
|
-
empty: string;
|
|
69
|
-
/** …and an empty `multiple` one. */
|
|
70
|
-
emptyMultiple: string;
|
|
71
|
-
/** The dropzone's second line (no `hint` given). Receives `accept` as a person
|
|
72
|
-
* reads it (`".pdf, image/png"`), or `""` when anything goes. */
|
|
73
|
-
hint: (accept: string) => string;
|
|
74
|
-
/** What a `busy` dropzone says in place of its body ("Uploading…"). */
|
|
75
|
-
busy: string;
|
|
76
|
-
}
|
|
77
|
-
declare const DEFAULT_FILE_PICKER_LABELS: FilePickerLabels;
|
|
78
|
-
type FileRejectionReason = "type" | "size" | "count" | "invalid";
|
|
79
|
-
/** One file the picker refused, and why. `message` is already translated (see
|
|
80
|
-
* {@link FilePickerLabels}, or the caller's `invalidMessage`), so a host that just
|
|
81
|
-
* wants to show it can render `rejections[0].message` as is. */
|
|
82
|
-
interface FileRejection {
|
|
83
|
-
file: File;
|
|
84
|
-
reason: FileRejectionReason;
|
|
85
|
-
message: string;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Does `file` satisfy an `accept` string, the way the browser's dialog reads it?
|
|
89
|
-
* Comma-separated tokens: `.ext` (case-insensitive suffix of the name), `type/*`
|
|
90
|
-
* (a MIME family) or an exact MIME type. An empty or absent `accept` takes anything.
|
|
91
|
-
*
|
|
92
|
-
* A file with no `type` — common for `.step`, `.dat`, anything the OS has no MIME
|
|
93
|
-
* mapping for — can only match by extension, which is why lenkbank lists `.stp` AND
|
|
94
|
-
* `model/step`: that is how `accept` has to be written for the dialog anyway.
|
|
95
|
-
*/
|
|
96
|
-
declare function matchesAccept(file: File, accept: string | undefined): boolean;
|
|
97
|
-
/** @internal `" .PDF, image/png ,"` => `".pdf, image/png"` — `accept` as a person reads
|
|
98
|
-
* it. Also the dropzone's default hint. */
|
|
99
|
-
declare function formatAccept(accept: string): string;
|
|
100
|
-
/** What the pickers screen a pick with. All optional; nothing set accepts everything. */
|
|
101
|
-
interface FileScreenOptions {
|
|
102
|
-
accept?: string;
|
|
103
|
-
/** Bytes. Larger files are refused with reason `"size"`. */
|
|
104
|
-
maxSize?: number;
|
|
105
|
-
/** How many files one pick may deliver. The rest are refused with reason `"count"`
|
|
106
|
-
* — first come, first kept. For a running cap ("at most 5 attachments") pass what
|
|
107
|
-
* is LEFT: `maxFiles={5 - attachments.length}`. */
|
|
108
|
-
maxFiles?: number;
|
|
109
|
-
/** The caller's own check, after `accept` and `maxSize`. */
|
|
110
|
-
isValid?: (file: File) => boolean;
|
|
111
|
-
/** The message for an `isValid` refusal; `labels.rejectedInvalid` otherwise. */
|
|
112
|
-
invalidMessage?: string;
|
|
113
|
-
}
|
|
114
|
-
/** @internal Split a pick into the files that pass and the ones that do not. */
|
|
115
|
-
declare function screenFiles(files: readonly File[], opts: FileScreenOptions, labels: FilePickerLabels, formatSize: (bytes: number) => string): {
|
|
116
|
-
accepted: File[];
|
|
117
|
-
rejected: FileRejection[];
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Judges a pick as a whole — keksdose's "refuse the pick if any file is bad", which
|
|
121
|
-
* with `onFiles` + `onReject` alone had to be rebuilt from two calls in a microtask.
|
|
122
|
-
*
|
|
123
|
-
* Called ONCE per pick, after screening and before `onFiles` / `onReject`, with both
|
|
124
|
-
* halves (either may be empty). Return `false` to refuse the whole pick: the accepted
|
|
125
|
-
* files are not delivered, `onReject` still receives what screening refused, and one
|
|
126
|
-
* sentence (`labels.rejectedPick`) is spoken for the pick instead of a per-file one.
|
|
127
|
-
* Return nothing to let the pick through as usual.
|
|
128
|
-
*
|
|
129
|
-
* ```tsx
|
|
130
|
-
* onPick={(ok, bad) => bad.length === 0 || false} // all or nothing
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
type FilePickHandler = (accepted: File[], rejected: FileRejection[]) => boolean | void;
|
|
134
|
-
/** @internal The shared tail of both pickers: run `onPick`, and say whether the pick
|
|
135
|
-
* stands. A pick with nothing accepted has nothing to refuse, so `false` there is
|
|
136
|
-
* treated as no verdict and the usual per-file messages are kept. */
|
|
137
|
-
declare function judgePick(onPick: FilePickHandler | undefined, accepted: File[], rejected: FileRejection[]): boolean;
|
|
138
|
-
/** One sentence for a whole batch of refusals: the file's own message for one, a
|
|
139
|
-
* count for several — reading out five sentences in a row helps nobody. */
|
|
140
|
-
declare function summariseRejections(rejected: readonly FileRejection[], labels: FilePickerLabels): string;
|
|
141
|
-
interface UseFilePickerOptions extends FileScreenOptions {
|
|
142
|
-
/** Let one pick deliver several files. Without it a drop of several keeps the first. */
|
|
143
|
-
multiple?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Ask a phone for its camera instead of the file chooser: `"environment"` is the
|
|
146
|
-
* back camera, `"user"` the front. A HINT — desktop browsers ignore it, and Chrome
|
|
147
|
-
* drops it when `multiple` is also set (a camera cannot deliver a list), which is why
|
|
148
|
-
* keksdose's camera input has no `multiple`. Pass one or the other.
|
|
149
|
-
*/
|
|
150
|
-
capture?: boolean | "user" | "environment";
|
|
151
|
-
/** The files that passed, in pick order. Never called with an empty array.
|
|
152
|
-
* Optional since 0.7 for a caller that takes the pick through `onPick` alone. */
|
|
153
|
-
onFiles?: (files: File[]) => void;
|
|
154
|
-
/** See {@link FilePickHandler}: the whole pick at once, with the power to refuse it. */
|
|
155
|
-
onPick?: FilePickHandler;
|
|
156
|
-
/** The files that did not, with a translated message each. The refusals are also
|
|
157
|
-
* spoken through a live region, so this is for SHOWING them, not for a11y. */
|
|
158
|
-
onReject?: (rejections: FileRejection[]) => void;
|
|
159
|
-
/** `open()` and `take()` do nothing while set. */
|
|
160
|
-
disabled?: boolean;
|
|
161
|
-
/** Per-instance overrides of the `filePicker` label namespace. */
|
|
162
|
-
labels?: Partial<FilePickerLabels>;
|
|
163
|
-
}
|
|
164
|
-
interface UseFilePickerReturn {
|
|
165
|
-
/** Open the system picker. Call it from a click handler — browsers only open a file
|
|
166
|
-
* dialog in response to a user gesture. */
|
|
167
|
-
open: () => void;
|
|
168
|
-
/** Screen and deliver files that arrived some other way — a drop, a paste. Honours
|
|
169
|
-
* `multiple` (only the first file without it) and every check. */
|
|
170
|
-
take: (files: ArrayLike<File> | null | undefined) => void;
|
|
171
|
-
/** The hidden input and the live region. Render it once, anywhere — it takes no
|
|
172
|
-
* space and needs no positioned ancestor. */
|
|
173
|
-
element: ReactElement;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* The headless half of {@link FileButton}: a hidden file input you can open from any
|
|
177
|
-
* control, with the reset, the screening and the announcement built in.
|
|
178
|
-
*
|
|
179
|
-
* ```tsx
|
|
180
|
-
* const picker = useFilePicker({ accept: ".pdf", onFiles: ([f]) => upload(f) });
|
|
181
|
-
* return <>{picker.element}<DetailTableCard onAdd={picker.open} … /></>;
|
|
182
|
-
* ```
|
|
183
|
-
*/
|
|
184
|
-
declare function useFilePicker({ accept, multiple, capture, maxSize, maxFiles, isValid, invalidMessage, onFiles, onPick, onReject, disabled, labels: labelsProp, }: UseFilePickerOptions): UseFilePickerReturn;
|
|
185
|
-
type ButtonOwnProps = ComponentPropsWithoutRef<typeof Button>;
|
|
186
|
-
interface FileButtonProps extends Omit<UseFilePickerOptions, "disabled">, Omit<ButtonOwnProps, "type" | "children" | "accept" | "capture" | "multiple"> {
|
|
187
|
-
/** The button's content — usually an icon and a word. It is the accessible name. */
|
|
188
|
-
children: ReactNode;
|
|
189
|
-
/** Busy: disabled, `aria-busy`, and a spinner before the content — for "uploading". */
|
|
190
|
-
pending?: boolean;
|
|
191
|
-
/** Also accept files dropped ON the button (lenkbank's "drop onto the button").
|
|
192
|
-
* Off by default: a button that silently takes drops is a surprise on a page that
|
|
193
|
-
* has a real drop target elsewhere. */
|
|
194
|
-
droppable?: boolean;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* {@link useFilePicker} behind a {@link Button}: `variant` and every other button prop
|
|
198
|
-
* pass through, and the ref is the `<button>` (so `ref.current.click()` opens the
|
|
199
|
-
* picker from elsewhere too).
|
|
200
|
-
*
|
|
201
|
-
* ```tsx
|
|
202
|
-
* <FileButton accept="image/*,application/pdf" capture="environment" variant="secondary"
|
|
203
|
-
* maxSize={10_000_000} onFiles={([f]) => upload(f)} onReject={([r]) => setError(r.message)}>
|
|
204
|
-
* <Camera aria-hidden /> Photograph receipt
|
|
205
|
-
* </FileButton>
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
declare const FileButton: react.ForwardRefExoticComponent<FileButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
209
|
-
|
|
210
|
-
export { DEFAULT_FILE_PICKER_LABELS, FileButton, type FileButtonProps, type FilePickHandler, type FilePickerLabels, type FileRejection, type FileRejectionReason, type FileScreenOptions, type UseFilePickerOptions, type UseFilePickerReturn, formatAccept, judgePick, matchesAccept, screenFiles, summariseRejections, useFilePicker };
|
|
12
|
+
import '../lib/clipping.js';
|
|
13
|
+
import '../wizard/types.js';
|
|
14
|
+
import '../tour/tour.js';
|
|
15
|
+
import '../search/command-palette.js';
|
|
16
|
+
import '../search/global-search.js';
|
|
17
|
+
import '../search/search-index.js';
|
|
18
|
+
import './month-picker.js';
|
|
19
|
+
import './page-contents.js';
|
|
20
|
+
import './series-chart-labels.js';
|
|
21
|
+
import './pie-chart-labels.js';
|
|
22
|
+
import './sparkline.js';
|
|
23
|
+
import './stat-tile.js';
|
|
24
|
+
import './signature-pad.js';
|
|
25
|
+
import './password-strength.js';
|
|
26
|
+
import './danger-confirm.js';
|
|
27
|
+
import './swatch-picker.js';
|
|
28
|
+
import './tile-radio.js';
|
|
29
|
+
import './icon-picker.js';
|
|
30
|
+
import './dialog-frame.js';
|
|
31
|
+
import './modal.js';
|
|
32
|
+
import '../hooks/use-search-param-state.js';
|
|
33
|
+
import './measured-grid.js';
|
|
34
|
+
import '../feedback/feedback-attachment.js';
|
|
35
|
+
import '../feedback/feedback-dialog.js';
|
|
36
|
+
import '../feedback/feedback-thread.js';
|
|
37
|
+
import '../feedback/feedback-inbox.js';
|
|
38
|
+
import './account-settings-labels.js';
|
|
39
|
+
import './confirm-dialog.js';
|
|
40
|
+
import './floating-panel.js';
|
|
41
|
+
import './bulk-action-bar.js';
|
|
42
|
+
import './list.js';
|
|
43
|
+
import './breadcrumbs.js';
|
|
44
|
+
import './toast.js';
|
|
45
|
+
import './description-list.js';
|
|
46
|
+
import './line-items.js';
|
|
47
|
+
import './progress-bar.js';
|
|
48
|
+
import './signed-amount.js';
|
|
49
|
+
import './error-boundary.js';
|
|
50
|
+
import './authed-image.js';
|
|
51
|
+
import '../hooks/use-authed-src.js';
|
|
52
|
+
import './image-grid.js';
|
|
53
|
+
import './lightbox.js';
|
|
@@ -1,9 +1,57 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
-
import { FileRejection, FilePickHandler, FilePickerLabels } from '
|
|
4
|
-
import './
|
|
3
|
+
import { ae as FileRejection, b8 as FilePickHandler, ad as FilePickerLabels } from '../kit-labels-v3biUF1L.js';
|
|
4
|
+
import './data-table-labels.js';
|
|
5
|
+
import './mini-calendar.js';
|
|
6
|
+
import './calendar-heatmap.js';
|
|
7
|
+
import './popover.js';
|
|
8
|
+
import './chip.js';
|
|
9
|
+
import 'lucide-react';
|
|
10
|
+
import './field-sync.js';
|
|
5
11
|
import './tooltip.js';
|
|
6
12
|
import '../hooks/use-anchored-rect.js';
|
|
13
|
+
import '../lib/clipping.js';
|
|
14
|
+
import '../wizard/types.js';
|
|
15
|
+
import '../tour/tour.js';
|
|
16
|
+
import '../search/command-palette.js';
|
|
17
|
+
import '../search/global-search.js';
|
|
18
|
+
import '../search/search-index.js';
|
|
19
|
+
import './month-picker.js';
|
|
20
|
+
import './page-contents.js';
|
|
21
|
+
import './series-chart-labels.js';
|
|
22
|
+
import './pie-chart-labels.js';
|
|
23
|
+
import './sparkline.js';
|
|
24
|
+
import './stat-tile.js';
|
|
25
|
+
import './signature-pad.js';
|
|
26
|
+
import './password-strength.js';
|
|
27
|
+
import './danger-confirm.js';
|
|
28
|
+
import './swatch-picker.js';
|
|
29
|
+
import './tile-radio.js';
|
|
30
|
+
import './icon-picker.js';
|
|
31
|
+
import './dialog-frame.js';
|
|
32
|
+
import './modal.js';
|
|
33
|
+
import '../hooks/use-search-param-state.js';
|
|
34
|
+
import './measured-grid.js';
|
|
35
|
+
import '../feedback/feedback-attachment.js';
|
|
36
|
+
import '../feedback/feedback-dialog.js';
|
|
37
|
+
import '../feedback/feedback-thread.js';
|
|
38
|
+
import '../feedback/feedback-inbox.js';
|
|
39
|
+
import './account-settings-labels.js';
|
|
40
|
+
import './confirm-dialog.js';
|
|
41
|
+
import './floating-panel.js';
|
|
42
|
+
import './bulk-action-bar.js';
|
|
43
|
+
import './list.js';
|
|
44
|
+
import './breadcrumbs.js';
|
|
45
|
+
import './toast.js';
|
|
46
|
+
import './description-list.js';
|
|
47
|
+
import './line-items.js';
|
|
48
|
+
import './progress-bar.js';
|
|
49
|
+
import './signed-amount.js';
|
|
50
|
+
import './error-boundary.js';
|
|
51
|
+
import './authed-image.js';
|
|
52
|
+
import '../hooks/use-authed-src.js';
|
|
53
|
+
import './image-grid.js';
|
|
54
|
+
import './lightbox.js';
|
|
7
55
|
|
|
8
56
|
/**
|
|
9
57
|
* Where a refused file's message goes.
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, MouseEvent, ReactElement, Ref, HTMLAttributes } from 'react';
|
|
3
|
+
import { TooltipSide } from './tooltip.js';
|
|
4
|
+
import '../hooks/use-anchored-rect.js';
|
|
5
|
+
import '../lib/clipping.js';
|
|
3
6
|
|
|
4
7
|
interface FloatingPanelLabels {
|
|
5
8
|
/** Accessible name of the panel header's X. */
|
|
6
9
|
close: string;
|
|
10
|
+
/**
|
|
11
|
+
* What a {@link FloatingAction}'s count badge adds to its accessible name ("3 new"),
|
|
12
|
+
* read after the label: "Invoices, 3 new". The dot itself is hidden from a reader —
|
|
13
|
+
* a bare "3" read out of context says nothing about what is counted.
|
|
14
|
+
*/
|
|
15
|
+
badge: (count: number) => string;
|
|
7
16
|
}
|
|
8
17
|
declare const DEFAULT_FLOATING_PANEL_LABELS: FloatingPanelLabels;
|
|
9
18
|
/** A LOGICAL corner: `bottom-end` is bottom-right in LTR and bottom-left in RTL. */
|
|
@@ -44,6 +53,49 @@ interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButton
|
|
|
44
53
|
* in both states; `aria-pressed` already says which one it is in.
|
|
45
54
|
*/
|
|
46
55
|
pressed?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Show `label` beside the icon: the EXTENDED FAB, a pill rather than a disc. For a
|
|
58
|
+
* corner control whose words are the point — kastlan's offline indicator
|
|
59
|
+
* (shared/offline/offline-indicator.tsx:39) is a pill saying "Offline — 2 photo(s)
|
|
60
|
+
* queued" / "Syncing…", hand-placed at `fixed bottom-4 left-4`, i.e. over the
|
|
61
|
+
* bottom nav and on the wrong side in RTL. Same height as the disc (3rem), so a
|
|
62
|
+
* {@link FloatingPanel} card above it still clears it.
|
|
63
|
+
*/
|
|
64
|
+
extended?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Announce `label` whenever it changes, through a polite `role="status"` region — for
|
|
67
|
+
* an extended FAB that REPORTS something (kastlan's offline/sync state), where a
|
|
68
|
+
* sighted user sees the words change and a screen reader user otherwise hears
|
|
69
|
+
* nothing until they happen to land on the button.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ A live region announces changes, not its own arrival: a FAB that mounts already
|
|
72
|
+
* saying "Offline" says it to nobody. Keep it mounted and pass `hidden` while there
|
|
73
|
+
* is nothing to report (kastlan returns `null` when online and idle); the region
|
|
74
|
+
* stays in the page, and the first real status is heard.
|
|
75
|
+
*/
|
|
76
|
+
live?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* `primary` (default): the solid brand disc of a page's main action. `surface`: the
|
|
79
|
+
* page's surface with a hairline border — for a FAB that is a status rather than a
|
|
80
|
+
* call to action, as kastlan's offline pill is (a brand pill would shout "press me"
|
|
81
|
+
* at a user who is merely offline). Ignored while `pressed` is set; a toggle has its
|
|
82
|
+
* own two looks.
|
|
83
|
+
*/
|
|
84
|
+
variant?: "primary" | "surface";
|
|
85
|
+
/**
|
|
86
|
+
* Hover and focus label in the kit {@link Tooltip}, instead of the native `title` —
|
|
87
|
+
* keksdose has ONE tooltip (dev#523) and wrapped its assistant launcher by hand,
|
|
88
|
+
* which cannot work: the tooltip's anchor is a `relative inline-flex` span, and this
|
|
89
|
+
* button is `fixed` and portalled. With `tooltip` the FAB positions a fixed wrapper
|
|
90
|
+
* instead and the button sits in the tooltip inside it. `true` shows the `label`;
|
|
91
|
+
* any other content shows that. Implies no native `title` (whatever `nativeTitle`
|
|
92
|
+
* says): one hover hint, not two. `style` stays on the button; the corner and
|
|
93
|
+
* `offset` move to the wrapper.
|
|
94
|
+
*/
|
|
95
|
+
tooltip?: ReactNode;
|
|
96
|
+
/** Where the {@link tooltip} opens. Default `top`; the bubble is portalled and kept on
|
|
97
|
+
* screen, so a corner button's label is not pushed off the edge. */
|
|
98
|
+
tooltipSide?: TooltipSide;
|
|
47
99
|
ref?: Ref<HTMLButtonElement>;
|
|
48
100
|
}
|
|
49
101
|
/**
|
|
@@ -63,7 +115,7 @@ interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButton
|
|
|
63
115
|
* Portalled, because `position: fixed` inside any transformed ancestor (an animated
|
|
64
116
|
* page transition) is fixed to that ancestor, not to the screen.
|
|
65
117
|
*/
|
|
66
|
-
declare function FloatingActionButton({ label, icon, corner, offset, nativeTitle, pressed, className, style, type, title, ...rest }: FloatingActionButtonProps): react.JSX.Element;
|
|
118
|
+
declare function FloatingActionButton({ label, icon, corner, offset, nativeTitle, pressed, extended, live, variant, tooltip, tooltipSide, className, style, type, title, ...rest }: FloatingActionButtonProps): react.JSX.Element;
|
|
67
119
|
interface FloatingPanelProps {
|
|
68
120
|
/** The panel's heading, and its accessible name. */
|
|
69
121
|
title: ReactNode;
|
|
@@ -84,6 +136,10 @@ interface FloatingPanelProps {
|
|
|
84
136
|
/** The FAB's native `title` — see {@link FloatingActionButtonProps.nativeTitle}.
|
|
85
137
|
* `false` for keksdose's assistant launcher, under its one-tooltip rule (dev#523). */
|
|
86
138
|
fabNativeTitle?: boolean;
|
|
139
|
+
/** The FAB's kit tooltip — see {@link FloatingActionButtonProps.tooltip}. `true` for
|
|
140
|
+
* keksdose's assistant launcher, which wanted the kit bubble and had no way to
|
|
141
|
+
* put one on a fixed, portalled button (dev#523). */
|
|
142
|
+
fabTooltip?: ReactNode;
|
|
87
143
|
/** Default: `floatingPanel.close` from the {@link UiKitProvider}, else "Close". */
|
|
88
144
|
closeLabel?: string;
|
|
89
145
|
/**
|
|
@@ -129,6 +185,102 @@ interface FloatingPanelProps {
|
|
|
129
185
|
* panel unmounts when closed; an app that must keep a draft across a close keeps it in
|
|
130
186
|
* its own state, where it also survives a reload.
|
|
131
187
|
*/
|
|
132
|
-
declare function FloatingPanel({ title, fabLabel, fabIcon, open: openProp, defaultOpen, onOpenChange, corner, offset, fabNativeTitle, closeLabel, initialFocus, className, bodyClassName, children, }: FloatingPanelProps): react.JSX.Element;
|
|
188
|
+
declare function FloatingPanel({ title, fabLabel, fabIcon, open: openProp, defaultOpen, onOpenChange, corner, offset, fabNativeTitle, fabTooltip, closeLabel, initialFocus, className, bodyClassName, children, }: FloatingPanelProps): react.JSX.Element;
|
|
189
|
+
interface FloatingActionGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "role"> {
|
|
190
|
+
/** Name the group ("Register actions"); a reader then introduces the members as one
|
|
191
|
+
* set. A group with no name is one more unlabelled wrapper. */
|
|
192
|
+
"aria-label"?: string;
|
|
193
|
+
/** Default `bottom-end`. */
|
|
194
|
+
corner?: FloatingCorner;
|
|
195
|
+
/** Distance above the nav / home indicator — see {@link FloatingActionButtonProps.offset}. */
|
|
196
|
+
offset?: string;
|
|
197
|
+
/** {@link FloatingAction}s, in reading order. */
|
|
198
|
+
children: ReactNode;
|
|
199
|
+
ref?: Ref<HTMLDivElement>;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A floating pill of {@link FloatingAction}s — one to four `size-12` toggles, actions
|
|
203
|
+
* or links with hairline dividers — pinned to a corner exactly as the
|
|
204
|
+
* {@link FloatingActionButton} is: `--app-nav-h` and the home indicator cleared, a
|
|
205
|
+
* logical corner, portalled.
|
|
206
|
+
*
|
|
207
|
+
* keksdose built it twice by hand: the /transactions phone toolbar
|
|
208
|
+
* (transactions-page.tsx:644 — upcoming and pending toggles, an invoices link with a
|
|
209
|
+
* pending count, and the brand "+") and the feedback page's "awaiting only" toggle
|
|
210
|
+
* (feedback-page.tsx:854, one button in the group anyway, so the two pages look
|
|
211
|
+
* alike). Both at `right-4 bottom-20` — `right`, not `end`, so over the page's leading
|
|
212
|
+
* edge in RTL — with `divide-x`, slate hovers, and each member's `Tooltip` spelled out.
|
|
213
|
+
*
|
|
214
|
+
* `role="group"`, NOT a toolbar: every member keeps its own tab stop, as the
|
|
215
|
+
* hand-built ones did, and there is no arrow-key roving to learn. Hide it where it
|
|
216
|
+
* does not belong with a class (`md:hidden`, as both keksdose pages do).
|
|
217
|
+
*/
|
|
218
|
+
declare function FloatingActionGroup({ corner, offset, className, style, children, ...rest }: FloatingActionGroupProps): react.JSX.Element;
|
|
219
|
+
/** What {@link FloatingActionProps.renderLink} is handed. Spread it onto your router's
|
|
220
|
+
* link, mapping `href` — `renderLink={({ href, ...p }) => <Link to={href} {...p} />}`. */
|
|
221
|
+
interface FloatingActionLinkProps {
|
|
222
|
+
href: string;
|
|
223
|
+
/** The member's whole look — keep it. */
|
|
224
|
+
className: string;
|
|
225
|
+
children: ReactNode;
|
|
226
|
+
"aria-label": string;
|
|
227
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
228
|
+
[key: `aria-${string}`]: string | boolean | number | undefined;
|
|
229
|
+
[key: `data-${string}`]: unknown;
|
|
230
|
+
}
|
|
231
|
+
interface FloatingActionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick"> {
|
|
232
|
+
/** The accessible name, and the tooltip's text. Keep it the same in both states of a
|
|
233
|
+
* toggle; `aria-pressed` says which one it is in. */
|
|
234
|
+
label: string;
|
|
235
|
+
icon: ReactNode;
|
|
236
|
+
/** Make it a toggle: `aria-pressed` and the brand "on" look (the brand glyph on the
|
|
237
|
+
* quiet brand fill), as {@link FloatingActionButtonProps.pressed}. Ignored on a link.
|
|
238
|
+
* For the state without the tint, see {@link pressedStyle}. */
|
|
239
|
+
pressed?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* How `pressed` looks. `tint` (default): the brand "on" look. `plain`: the member
|
|
242
|
+
* keeps its quiet look in both states and only `aria-pressed` changes — for a toggle
|
|
243
|
+
* whose icon already says which state it is in (keksdose's /transactions "Upcoming"
|
|
244
|
+
* swaps two icons; a tint on top said it twice). The same as passing `aria-pressed`
|
|
245
|
+
* without `pressed`, which also rides through untinted.
|
|
246
|
+
*/
|
|
247
|
+
pressedStyle?: "tint" | "plain";
|
|
248
|
+
/**
|
|
249
|
+
* `primary`: the brand-filled member, for the group's main action (the /transactions
|
|
250
|
+
* "+"). Default: the quiet one.
|
|
251
|
+
*/
|
|
252
|
+
variant?: "default" | "primary";
|
|
253
|
+
/**
|
|
254
|
+
* A count in a dot at the member's top end corner — the /transactions invoices link's
|
|
255
|
+
* pending count. Nothing is drawn for `0` or less; above 99 it reads `99+`. The count
|
|
256
|
+
* joins the accessible name through `floatingPanel.badge` ("Invoices, 3 new"), or
|
|
257
|
+
* `badgeLabel` when passed.
|
|
258
|
+
*/
|
|
259
|
+
badge?: number;
|
|
260
|
+
/** The badge's words for a reader, replacing `floatingPanel.badge` — "3 to review". */
|
|
261
|
+
badgeLabel?: string;
|
|
262
|
+
/** The dot's colour. Default `warning`, the pending count's. */
|
|
263
|
+
badgeTone?: "warning" | "danger" | "brand";
|
|
264
|
+
/** Show `label` in the kit {@link Tooltip} on hover and focus. Default `true`: the
|
|
265
|
+
* members are icon-only and this is their only visible label. */
|
|
266
|
+
tooltip?: boolean;
|
|
267
|
+
/** Where the tooltip opens. Default `top` — the group sits at the bottom of the screen. */
|
|
268
|
+
tooltipSide?: TooltipSide;
|
|
269
|
+
/** Make it a link — the /transactions invoices member. Drawn by `renderLink`, else
|
|
270
|
+
* the `<UiKitProvider linkComponent>` (an in-app `href`), else a plain `<a>`. */
|
|
271
|
+
href?: string;
|
|
272
|
+
/** Render the link through your router's `Link` — see {@link FloatingActionLinkProps}. */
|
|
273
|
+
renderLink?: (props: FloatingActionLinkProps) => ReactElement;
|
|
274
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
275
|
+
ref?: Ref<HTMLButtonElement>;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* One member of a {@link FloatingActionGroup}: a `size-12` icon button, toggle or link
|
|
279
|
+
* with its label in a styled tooltip — what each keksdose member wrapped by hand in
|
|
280
|
+
* `<Tooltip portal>`. The tooltip is portalled because the group clips (`overflow-hidden`
|
|
281
|
+
* keeps the brand member's fill inside the pill's corners), and the focus ring is inset
|
|
282
|
+
* for the same reason.
|
|
283
|
+
*/
|
|
284
|
+
declare function FloatingAction({ label, icon, pressed, pressedStyle, variant, badge, badgeLabel, badgeTone, tooltip, tooltipSide, href, renderLink, className, type, onClick, ref, ...rest }: FloatingActionProps): react.JSX.Element;
|
|
133
285
|
|
|
134
|
-
export { DEFAULT_FLOATING_PANEL_LABELS, FloatingActionButton, type FloatingActionButtonProps, type FloatingCorner, FloatingPanel, type FloatingPanelLabels, type FloatingPanelProps };
|
|
286
|
+
export { DEFAULT_FLOATING_PANEL_LABELS, FloatingAction, FloatingActionButton, type FloatingActionButtonProps, FloatingActionGroup, type FloatingActionGroupProps, type FloatingActionLinkProps, type FloatingActionProps, type FloatingCorner, FloatingPanel, type FloatingPanelLabels, type FloatingPanelProps };
|