@lssm-tech/lib.ui-kit 4.1.6
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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/ui/accordion.js +1 -0
- package/dist/browser/ui/alert-dialog.js +1 -0
- package/dist/browser/ui/alert.js +1 -0
- package/dist/browser/ui/aspect-ratio.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/FilterSelect.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/index.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/types.js +0 -0
- package/dist/browser/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -0
- package/dist/browser/ui/atoms/LoadingSpinner/index.js +1 -0
- package/dist/browser/ui/atoms/Pagination/Pagination.js +1 -0
- package/dist/browser/ui/atoms/Pagination/index.js +1 -0
- package/dist/browser/ui/atoms/Pagination/types.js +0 -0
- package/dist/browser/ui/atoms/SearchInput/SearchInput.js +1 -0
- package/dist/browser/ui/atoms/SearchInput/index.js +1 -0
- package/dist/browser/ui/atoms/SearchInput/types.js +0 -0
- package/dist/browser/ui/avatar.js +1 -0
- package/dist/browser/ui/badge.js +1 -0
- package/dist/browser/ui/breadcrumb.js +1 -0
- package/dist/browser/ui/button.js +1 -0
- package/dist/browser/ui/card.js +1 -0
- package/dist/browser/ui/carousel.js +1 -0
- package/dist/browser/ui/checkbox.js +1 -0
- package/dist/browser/ui/collapsible.js +1 -0
- package/dist/browser/ui/combobox.js +1 -0
- package/dist/browser/ui/command.js +1 -0
- package/dist/browser/ui/context-menu.js +1 -0
- package/dist/browser/ui/contracts.typecheck.js +0 -0
- package/dist/browser/ui/data-table.js +1 -0
- package/dist/browser/ui/date-picker.js +1 -0
- package/dist/browser/ui/date-range-picker.js +1 -0
- package/dist/browser/ui/datetime-picker.js +1 -0
- package/dist/browser/ui/dialog.js +1 -0
- package/dist/browser/ui/dropdown-menu.js +1 -0
- package/dist/browser/ui/empty-state.js +1 -0
- package/dist/browser/ui/empty.js +1 -0
- package/dist/browser/ui/fab.js +1 -0
- package/dist/browser/ui/field.js +1 -0
- package/dist/browser/ui/form.js +1 -0
- package/dist/browser/ui/hover-card.js +1 -0
- package/dist/browser/ui/icons/Check.js +1 -0
- package/dist/browser/ui/icons/ChevronDown.js +1 -0
- package/dist/browser/ui/icons/ChevronRight.js +1 -0
- package/dist/browser/ui/icons/ChevronUp.js +1 -0
- package/dist/browser/ui/icons/CircleUser.js +1 -0
- package/dist/browser/ui/icons/Info.js +1 -0
- package/dist/browser/ui/icons/Key.js +1 -0
- package/dist/browser/ui/icons/MoonStar.js +1 -0
- package/dist/browser/ui/icons/Sun.js +1 -0
- package/dist/browser/ui/icons/X.js +1 -0
- package/dist/browser/ui/icons/iconWithClassName.js +1 -0
- package/dist/browser/ui/input-group.js +1 -0
- package/dist/browser/ui/input-otp.js +1 -0
- package/dist/browser/ui/input-password.js +1 -0
- package/dist/browser/ui/input.js +1 -0
- package/dist/browser/ui/label.js +1 -0
- package/dist/browser/ui/link.js +1 -0
- package/dist/browser/ui/list.js +1 -0
- package/dist/browser/ui/loading-button.js +1 -0
- package/dist/browser/ui/loading-overlay.js +1 -0
- package/dist/browser/ui/loading-screen.js +1 -0
- package/dist/browser/ui/marketing/FeatureGrid.js +1 -0
- package/dist/browser/ui/marketing/Hero.js +1 -0
- package/dist/browser/ui/marketing/PricingTable.js +1 -0
- package/dist/browser/ui/marketing/index.js +1 -0
- package/dist/browser/ui/menubar.js +1 -0
- package/dist/browser/ui/molecules/Autocomplete/index.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/SearchAndFilter.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/index.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/types.js +0 -0
- package/dist/browser/ui/molecules/SkeletonList.js +1 -0
- package/dist/browser/ui/native-select.js +1 -0
- package/dist/browser/ui/nativewind-env.d.js +0 -0
- package/dist/browser/ui/navigation-menu.js +1 -0
- package/dist/browser/ui/organisms/ErrorBoundary/ErrorBoundary.js +1 -0
- package/dist/browser/ui/organisms/ErrorBoundary/index.js +1 -0
- package/dist/browser/ui/organisms/ListPage/ListPage.js +1 -0
- package/dist/browser/ui/organisms/ListPage/index.js +1 -0
- package/dist/browser/ui/organisms/ListPage/types.js +0 -0
- package/dist/browser/ui/page-header.js +1 -0
- package/dist/browser/ui/password-strength.js +1 -0
- package/dist/browser/ui/popover.js +1 -0
- package/dist/browser/ui/portal.js +1 -0
- package/dist/browser/ui/progress.js +1 -0
- package/dist/browser/ui/radio-group.js +1 -0
- package/dist/browser/ui/select.js +1 -0
- package/dist/browser/ui/separator.js +1 -0
- package/dist/browser/ui/sheet.js +1 -0
- package/dist/browser/ui/sidebar.js +1 -0
- package/dist/browser/ui/skeleton.js +1 -0
- package/dist/browser/ui/slider.js +1 -0
- package/dist/browser/ui/stack.js +1 -0
- package/dist/browser/ui/stepper.js +1 -0
- package/dist/browser/ui/switch.js +1 -0
- package/dist/browser/ui/table.js +1 -0
- package/dist/browser/ui/tabs.js +1 -0
- package/dist/browser/ui/text.js +1 -0
- package/dist/browser/ui/textarea.js +1 -0
- package/dist/browser/ui/time-picker.js +1 -0
- package/dist/browser/ui/toast.js +1 -0
- package/dist/browser/ui/toggle-group.js +1 -0
- package/dist/browser/ui/toggle.js +1 -0
- package/dist/browser/ui/toolbar.js +1 -0
- package/dist/browser/ui/tooltip.js +1 -0
- package/dist/browser/ui/typography.js +1 -0
- package/dist/browser/ui/useColorScheme.js +1 -0
- package/dist/browser/ui/useListState.js +1 -0
- package/dist/browser/ui/usecases/UseCaseCard.js +1 -0
- package/dist/browser/ui/usecases/UserStoryCard.js +1 -0
- package/dist/browser/ui/usecases/index.js +1 -0
- package/dist/browser/ui/utils.js +1 -0
- package/dist/browser/ui/visualization/Visualization.js +1 -0
- package/dist/browser/ui/visualization/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/ui/accordion.d.ts +16 -0
- package/dist/ui/accordion.js +2 -0
- package/dist/ui/alert-dialog.d.ts +46 -0
- package/dist/ui/alert-dialog.js +2 -0
- package/dist/ui/alert.d.ts +17 -0
- package/dist/ui/alert.js +2 -0
- package/dist/ui/aspect-ratio.d.ts +8 -0
- package/dist/ui/aspect-ratio.js +2 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts +3 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.js +2 -0
- package/dist/ui/atoms/FilterSelect/index.d.ts +2 -0
- package/dist/ui/atoms/FilterSelect/index.js +2 -0
- package/dist/ui/atoms/FilterSelect/types.d.ts +5 -0
- package/dist/ui/atoms/FilterSelect/types.js +1 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +2 -0
- package/dist/ui/atoms/LoadingSpinner/index.d.ts +1 -0
- package/dist/ui/atoms/LoadingSpinner/index.js +2 -0
- package/dist/ui/atoms/Pagination/Pagination.d.ts +3 -0
- package/dist/ui/atoms/Pagination/Pagination.js +2 -0
- package/dist/ui/atoms/Pagination/index.d.ts +2 -0
- package/dist/ui/atoms/Pagination/index.js +2 -0
- package/dist/ui/atoms/Pagination/types.d.ts +3 -0
- package/dist/ui/atoms/Pagination/types.js +1 -0
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts +3 -0
- package/dist/ui/atoms/SearchInput/SearchInput.js +2 -0
- package/dist/ui/atoms/SearchInput/index.d.ts +2 -0
- package/dist/ui/atoms/SearchInput/index.js +2 -0
- package/dist/ui/atoms/SearchInput/types.d.ts +3 -0
- package/dist/ui/atoms/SearchInput/types.js +1 -0
- package/dist/ui/avatar.d.ts +13 -0
- package/dist/ui/avatar.js +2 -0
- package/dist/ui/badge.d.ts +11 -0
- package/dist/ui/badge.js +2 -0
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.js +2 -0
- package/dist/ui/button.d.ts +16 -0
- package/dist/ui/button.js +2 -0
- package/dist/ui/card.d.ts +22 -0
- package/dist/ui/card.js +2 -0
- package/dist/ui/carousel.d.ts +1 -0
- package/dist/ui/carousel.js +2 -0
- package/dist/ui/checkbox.d.ts +12 -0
- package/dist/ui/checkbox.js +2 -0
- package/dist/ui/collapsible.d.ts +27 -0
- package/dist/ui/collapsible.js +2 -0
- package/dist/ui/combobox.d.ts +17 -0
- package/dist/ui/combobox.js +2 -0
- package/dist/ui/command.d.ts +1 -0
- package/dist/ui/command.js +2 -0
- package/dist/ui/context-menu.d.ts +83 -0
- package/dist/ui/context-menu.js +2 -0
- package/dist/ui/contracts.typecheck.d.ts +1 -0
- package/dist/ui/contracts.typecheck.js +1 -0
- package/dist/ui/data-table.d.ts +8 -0
- package/dist/ui/data-table.js +2 -0
- package/dist/ui/data-table.smoke.test.d.ts +1 -0
- package/dist/ui/date-picker.d.ts +4 -0
- package/dist/ui/date-picker.js +2 -0
- package/dist/ui/date-range-picker.d.ts +6 -0
- package/dist/ui/date-range-picker.js +2 -0
- package/dist/ui/datetime-picker.d.ts +6 -0
- package/dist/ui/datetime-picker.js +2 -0
- package/dist/ui/dialog.d.ts +51 -0
- package/dist/ui/dialog.js +2 -0
- package/dist/ui/dropdown-menu.d.ts +84 -0
- package/dist/ui/dropdown-menu.js +2 -0
- package/dist/ui/empty-state.d.ts +9 -0
- package/dist/ui/empty-state.js +2 -0
- package/dist/ui/empty.d.ts +12 -0
- package/dist/ui/empty.js +2 -0
- package/dist/ui/fab.d.ts +21 -0
- package/dist/ui/fab.js +2 -0
- package/dist/ui/field.d.ts +21 -0
- package/dist/ui/field.js +2 -0
- package/dist/ui/form.d.ts +29 -0
- package/dist/ui/form.js +2 -0
- package/dist/ui/hover-card.d.ts +25 -0
- package/dist/ui/hover-card.js +2 -0
- package/dist/ui/icons/Check.d.ts +2 -0
- package/dist/ui/icons/Check.js +2 -0
- package/dist/ui/icons/ChevronDown.d.ts +2 -0
- package/dist/ui/icons/ChevronDown.js +2 -0
- package/dist/ui/icons/ChevronRight.d.ts +2 -0
- package/dist/ui/icons/ChevronRight.js +2 -0
- package/dist/ui/icons/ChevronUp.d.ts +2 -0
- package/dist/ui/icons/ChevronUp.js +2 -0
- package/dist/ui/icons/CircleUser.d.ts +2 -0
- package/dist/ui/icons/CircleUser.js +2 -0
- package/dist/ui/icons/Info.d.ts +2 -0
- package/dist/ui/icons/Info.js +2 -0
- package/dist/ui/icons/Key.d.ts +2 -0
- package/dist/ui/icons/Key.js +2 -0
- package/dist/ui/icons/MoonStar.d.ts +2 -0
- package/dist/ui/icons/MoonStar.js +2 -0
- package/dist/ui/icons/Sun.d.ts +2 -0
- package/dist/ui/icons/Sun.js +2 -0
- package/dist/ui/icons/X.d.ts +2 -0
- package/dist/ui/icons/X.js +2 -0
- package/dist/ui/icons/iconWithClassName.d.ts +2 -0
- package/dist/ui/icons/iconWithClassName.js +2 -0
- package/dist/ui/input-group.d.ts +36 -0
- package/dist/ui/input-group.js +2 -0
- package/dist/ui/input-otp.d.ts +20 -0
- package/dist/ui/input-otp.js +2 -0
- package/dist/ui/input-password.d.ts +10 -0
- package/dist/ui/input-password.js +2 -0
- package/dist/ui/input.d.ts +8 -0
- package/dist/ui/input.js +2 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +2 -0
- package/dist/ui/link.d.ts +6 -0
- package/dist/ui/link.js +2 -0
- package/dist/ui/list.d.ts +23 -0
- package/dist/ui/list.js +2 -0
- package/dist/ui/loading-button.d.ts +9 -0
- package/dist/ui/loading-button.js +2 -0
- package/dist/ui/loading-overlay.d.ts +7 -0
- package/dist/ui/loading-overlay.js +2 -0
- package/dist/ui/loading-screen.d.ts +6 -0
- package/dist/ui/loading-screen.js +2 -0
- package/dist/ui/marketing/FeatureGrid.d.ts +4 -0
- package/dist/ui/marketing/FeatureGrid.js +2 -0
- package/dist/ui/marketing/Hero.d.ts +16 -0
- package/dist/ui/marketing/Hero.js +2 -0
- package/dist/ui/marketing/PricingTable.d.ts +4 -0
- package/dist/ui/marketing/PricingTable.js +2 -0
- package/dist/ui/marketing/index.d.ts +3 -0
- package/dist/ui/marketing/index.js +2 -0
- package/dist/ui/menubar.d.ts +80 -0
- package/dist/ui/menubar.js +2 -0
- package/dist/ui/molecules/Autocomplete/index.d.ts +1 -0
- package/dist/ui/molecules/Autocomplete/index.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts +3 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/index.d.ts +2 -0
- package/dist/ui/molecules/SearchAndFilter/index.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/types.d.ts +4 -0
- package/dist/ui/molecules/SearchAndFilter/types.js +1 -0
- package/dist/ui/molecules/SkeletonList.d.ts +7 -0
- package/dist/ui/molecules/SkeletonList.js +2 -0
- package/dist/ui/native-select.d.ts +29 -0
- package/dist/ui/native-select.js +2 -0
- package/dist/ui/nativewind-env.d.js +1 -0
- package/dist/ui/navigation-menu.d.ts +44 -0
- package/dist/ui/navigation-menu.js +2 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +25 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +2 -0
- package/dist/ui/organisms/ErrorBoundary/index.d.ts +2 -0
- package/dist/ui/organisms/ErrorBoundary/index.js +2 -0
- package/dist/ui/organisms/ListPage/ListPage.d.ts +2 -0
- package/dist/ui/organisms/ListPage/ListPage.js +2 -0
- package/dist/ui/organisms/ListPage/index.d.ts +2 -0
- package/dist/ui/organisms/ListPage/index.js +2 -0
- package/dist/ui/organisms/ListPage/types.d.ts +44 -0
- package/dist/ui/organisms/ListPage/types.js +1 -0
- package/dist/ui/page-header.d.ts +9 -0
- package/dist/ui/page-header.js +2 -0
- package/dist/ui/password-strength.d.ts +13 -0
- package/dist/ui/password-strength.js +2 -0
- package/dist/ui/popover.d.ts +23 -0
- package/dist/ui/popover.js +2 -0
- package/dist/ui/portal.d.ts +1 -0
- package/dist/ui/portal.js +2 -0
- package/dist/ui/progress.d.ts +7 -0
- package/dist/ui/progress.js +2 -0
- package/dist/ui/radio-group.d.ts +4 -0
- package/dist/ui/radio-group.js +2 -0
- package/dist/ui/select.d.ts +60 -0
- package/dist/ui/select.js +2 -0
- package/dist/ui/separator.d.ts +6 -0
- package/dist/ui/separator.js +2 -0
- package/dist/ui/sheet.d.ts +1 -0
- package/dist/ui/sheet.js +2 -0
- package/dist/ui/sidebar.d.ts +1 -0
- package/dist/ui/sidebar.js +2 -0
- package/dist/ui/skeleton.d.ts +4 -0
- package/dist/ui/skeleton.js +2 -0
- package/dist/ui/slider.d.ts +7 -0
- package/dist/ui/slider.js +2 -0
- package/dist/ui/stack.d.ts +43 -0
- package/dist/ui/stack.js +2 -0
- package/dist/ui/stepper.d.ts +10 -0
- package/dist/ui/stepper.js +2 -0
- package/dist/ui/switch.d.ts +7 -0
- package/dist/ui/switch.js +2 -0
- package/dist/ui/table.d.ts +24 -0
- package/dist/ui/table.js +2 -0
- package/dist/ui/tabs.d.ts +6 -0
- package/dist/ui/tabs.js +2 -0
- package/dist/ui/text.d.ts +12 -0
- package/dist/ui/text.js +2 -0
- package/dist/ui/textarea.d.ts +8 -0
- package/dist/ui/textarea.js +2 -0
- package/dist/ui/time-picker.d.ts +4 -0
- package/dist/ui/time-picker.js +2 -0
- package/dist/ui/toast.d.ts +40 -0
- package/dist/ui/toast.js +2 -0
- package/dist/ui/toggle-group.d.ts +15 -0
- package/dist/ui/toggle-group.js +2 -0
- package/dist/ui/toggle.d.ts +19 -0
- package/dist/ui/toggle.js +2 -0
- package/dist/ui/toolbar.d.ts +25 -0
- package/dist/ui/toolbar.js +2 -0
- package/dist/ui/tooltip.d.ts +27 -0
- package/dist/ui/tooltip.js +2 -0
- package/dist/ui/typography.d.ts +16 -0
- package/dist/ui/typography.js +2 -0
- package/dist/ui/useColorScheme.d.ts +6 -0
- package/dist/ui/useColorScheme.js +2 -0
- package/dist/ui/useListState.d.ts +6 -0
- package/dist/ui/useListState.js +2 -0
- package/dist/ui/usecases/UseCaseCard.d.ts +7 -0
- package/dist/ui/usecases/UseCaseCard.js +2 -0
- package/dist/ui/usecases/UserStoryCard.d.ts +5 -0
- package/dist/ui/usecases/UserStoryCard.js +2 -0
- package/dist/ui/usecases/index.d.ts +2 -0
- package/dist/ui/usecases/index.js +2 -0
- package/dist/ui/utils.d.ts +2 -0
- package/dist/ui/utils.js +2 -0
- package/dist/ui/visualization/Visualization.d.ts +7 -0
- package/dist/ui/visualization/Visualization.js +2 -0
- package/dist/ui/visualization/index.d.ts +1 -0
- package/dist/ui/visualization/index.js +2 -0
- package/package.json +1776 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# @contractspec/lib.ui-kit
|
|
2
|
+
|
|
3
|
+
`@contractspec/lib.ui-kit` provides cross-platform UI components for native-first and Expo-based surfaces, with most real usage happening through `./ui/*` subpaths rather than the root barrel.
|
|
4
|
+
|
|
5
|
+
Website: https://contractspec.io
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
`bun add @contractspec/lib.ui-kit`
|
|
10
|
+
|
|
11
|
+
or
|
|
12
|
+
|
|
13
|
+
`npm install @contractspec/lib.ui-kit`
|
|
14
|
+
|
|
15
|
+
## What belongs here
|
|
16
|
+
|
|
17
|
+
This package owns the native-first component layer for ContractSpec UI work:
|
|
18
|
+
|
|
19
|
+
- React Native and Expo component wrappers.
|
|
20
|
+
- Shared UI building blocks such as forms, tables, overlays, navigation, loading states, marketing blocks, and visualization surfaces.
|
|
21
|
+
- Platform-aware helpers such as `useColorScheme` and list state helpers.
|
|
22
|
+
|
|
23
|
+
Use this package for Expo and React Native surfaces. Do not use it as the design-token layer or as the framework-agnostic link package.
|
|
24
|
+
|
|
25
|
+
## API map
|
|
26
|
+
|
|
27
|
+
### Forms and inputs
|
|
28
|
+
|
|
29
|
+
- `./ui/input`
|
|
30
|
+
- `./ui/input-password`
|
|
31
|
+
- `./ui/textarea`
|
|
32
|
+
- `./ui/select`
|
|
33
|
+
- `./ui/form`
|
|
34
|
+
- `./ui/field`
|
|
35
|
+
|
|
36
|
+
Native contract-driven forms consume the shared `Field` semantics through the
|
|
37
|
+
design-system renderer; web-only input-addon composition remains in
|
|
38
|
+
`@contractspec/lib.ui-kit-web/ui/input-group` and the design-system platform
|
|
39
|
+
facade.
|
|
40
|
+
|
|
41
|
+
`./ui/input-password` provides the native masked password primitive with
|
|
42
|
+
current/new password autocomplete hints and a right-side visibility toggle.
|
|
43
|
+
|
|
44
|
+
### Overlays and menus
|
|
45
|
+
|
|
46
|
+
- `./ui/dialog`
|
|
47
|
+
- `./ui/alert-dialog`
|
|
48
|
+
- `./ui/popover`
|
|
49
|
+
- `./ui/sheet`
|
|
50
|
+
- `./ui/dropdown-menu`
|
|
51
|
+
- `./ui/context-menu`
|
|
52
|
+
- `./ui/portal`
|
|
53
|
+
- `./ui/toast`
|
|
54
|
+
- `./ui/toolbar`
|
|
55
|
+
|
|
56
|
+
### Navigation and display
|
|
57
|
+
|
|
58
|
+
- `./ui/link`
|
|
59
|
+
- `./ui/sidebar`
|
|
60
|
+
- `./ui/navigation-menu`
|
|
61
|
+
- `./ui/page-header`
|
|
62
|
+
- `./ui/table`
|
|
63
|
+
- `./ui/data-table`
|
|
64
|
+
- `./ui/card`
|
|
65
|
+
- `./ui/empty-state`
|
|
66
|
+
- `./ui/slider`
|
|
67
|
+
|
|
68
|
+
## Data table example
|
|
69
|
+
|
|
70
|
+
The canonical data-table example lives in
|
|
71
|
+
[`@contractspec/example.data-grid-showcase`](../../examples/data-grid-showcase/README.md).
|
|
72
|
+
Its native-first lane renders the same account-grid controller through
|
|
73
|
+
`@contractspec/lib.ui-kit/ui/data-table`:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
|
|
77
|
+
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
|
|
78
|
+
|
|
79
|
+
import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
|
|
80
|
+
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
|
|
81
|
+
import {
|
|
82
|
+
ExpandedRowContent,
|
|
83
|
+
ShowcaseToolbar,
|
|
84
|
+
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
|
|
85
|
+
|
|
86
|
+
export function NativeAccountGrid() {
|
|
87
|
+
const columns = useShowcaseColumns();
|
|
88
|
+
|
|
89
|
+
const controller = useContractTable({
|
|
90
|
+
data: SHOWCASE_ROWS,
|
|
91
|
+
columns,
|
|
92
|
+
selectionMode: 'single',
|
|
93
|
+
initialState: {
|
|
94
|
+
sorting: [{ id: 'arr', desc: true }],
|
|
95
|
+
pagination: { pageIndex: 0, pageSize: 4 },
|
|
96
|
+
columnVisibility: { notes: false },
|
|
97
|
+
columnPinning: { left: ['account'], right: [] },
|
|
98
|
+
},
|
|
99
|
+
renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
|
|
100
|
+
getCanExpand: () => true,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<DataTable
|
|
105
|
+
controller={controller}
|
|
106
|
+
toolbar={
|
|
107
|
+
<ShowcaseToolbar
|
|
108
|
+
controller={controller}
|
|
109
|
+
label="Native primitive"
|
|
110
|
+
primaryColumnId="account"
|
|
111
|
+
toggleColumnId="notes"
|
|
112
|
+
pinColumnId="owner"
|
|
113
|
+
sortColumnIds={['arr', 'renewalDate']}
|
|
114
|
+
/>
|
|
115
|
+
}
|
|
116
|
+
loading={false}
|
|
117
|
+
footer={\`Rows \${controller.rows.length}\`}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Cells receive overflow behavior from the table controller. Native renderers use
|
|
124
|
+
single-line ellipsis for `truncate` and `expand`, multiline text for `wrap`,
|
|
125
|
+
and preserve caller rendering for `none`.
|
|
126
|
+
|
|
127
|
+
This example explicitly demonstrates the same sorting, pagination, selection, column visibility, column resizing, left/right pinning, row expansion, loading, and empty-state contracts used by the browser lanes.
|
|
128
|
+
|
|
129
|
+
### Hooks, utilities, and grouped surfaces
|
|
130
|
+
|
|
131
|
+
- `./ui/useColorScheme`
|
|
132
|
+
- `./ui/useListState`
|
|
133
|
+
- `./ui/utils`
|
|
134
|
+
- grouped subpaths under `./ui/marketing`, `./ui/usecases`, and `./ui/visualization`
|
|
135
|
+
- icons under `./ui/icons/*`
|
|
136
|
+
- shared semantic contracts are defined in `@contractspec/lib.ui-kit-core/interfaces`
|
|
137
|
+
|
|
138
|
+
## Public surface
|
|
139
|
+
|
|
140
|
+
The current root entry exists, but it is not the meaningful consumer surface for this package.
|
|
141
|
+
|
|
142
|
+
Consumers should import `./ui/*` subpaths directly. The public surface is best understood in groups:
|
|
143
|
+
|
|
144
|
+
- atoms and controls
|
|
145
|
+
- forms
|
|
146
|
+
- overlays and menus
|
|
147
|
+
- navigation and layout
|
|
148
|
+
- data display
|
|
149
|
+
- loading and empty states
|
|
150
|
+
- marketing and use-case blocks
|
|
151
|
+
- organisms and visualization
|
|
152
|
+
- hooks, utilities, and icons
|
|
153
|
+
|
|
154
|
+
Use `package.json` as the exhaustive source of truth for all exported subpaths.
|
|
155
|
+
|
|
156
|
+
## Operational semantics and gotchas
|
|
157
|
+
|
|
158
|
+
- Consumers should import subpaths directly; the root package is not the useful primary API today.
|
|
159
|
+
- Many components wrap Expo, React Native, or RN-oriented primitives and dependencies.
|
|
160
|
+
- `./ui/link` is router-coupled through `expo-router`.
|
|
161
|
+
- `./ui/useColorScheme` is built on `nativewind`.
|
|
162
|
+
- `./ui/utils` exposes a local `cn()` helper, but the deeper compatibility dependency is `@contractspec/lib.ui-kit-core`.
|
|
163
|
+
- This package is native-first even when some components can render cross-platform through React Native Web.
|
|
164
|
+
|
|
165
|
+
## When not to use this package
|
|
166
|
+
|
|
167
|
+
- Do not use it for pure web-first Radix or Next.js surfaces.
|
|
168
|
+
- Do not use it for token or theming orchestration.
|
|
169
|
+
- Do not use it for framework-agnostic link behavior.
|
|
170
|
+
|
|
171
|
+
## Related packages
|
|
172
|
+
|
|
173
|
+
- `@contractspec/lib.ui-kit-core`: tiny shared utility layer used by the UI packages.
|
|
174
|
+
- `@contractspec/lib.ui-kit-web`: web-first component package for React and Next surfaces.
|
|
175
|
+
- `@contractspec/lib.design-system`: higher-level design-system and composition layer built on top of the UI packages.
|
|
176
|
+
|
|
177
|
+
## Local commands
|
|
178
|
+
|
|
179
|
+
- `bun run lint:check`
|
|
180
|
+
- `bun run typecheck`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as O}from"nativewind";function Y(W){O(W,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as Q}from"lucide-react-native";Y(Q);import{cn as R}from"@contractspec/lib.ui-kit-core/utils";import*as Z from"@rn-primitives/slot";import*as G from"react";import{Text as S}from"react-native";import{jsx as U}from"react/jsx-runtime";var H=G.createContext(void 0);function p({className:W,asChild:M=!1,...q}){let B=G.useContext(H);return U(M?Z.Text:S,{className:R("web:select-text text-base text-foreground",B,W),...q})}import{cn as z}from"@contractspec/lib.ui-kit-core/utils";import*as f from"@rn-primitives/accordion";import{Platform as X,Pressable as k,View as $}from"react-native";import J,{Extrapolation as D,FadeIn as F,FadeOutUp as b,interpolate as E,LayoutAnimationConfig as V,LinearTransition as I,useAnimatedStyle as P,useDerivedValue as w,withTiming as _}from"react-native-reanimated";import{jsx as y,jsxs as v}from"react/jsx-runtime";function i({children:W,...M}){return y(V,{skipEntering:!0,children:y(f.Root,{...M,asChild:X.OS!=="web",children:y(J.View,{layout:I.duration(200),children:W})})})}function n({className:W,value:M,...q}){return y(J.View,{className:"overflow-hidden",layout:I.duration(200),children:y(f.Item,{className:z("border-border border-b",W),value:M,...q})})}var g=X.OS==="web"?$:k;function a({className:W,children:M,...q}){let{isExpanded:B}=f.useItemContext(),K=w(()=>B?_(1,{duration:250}):_(0,{duration:200})),L=P(()=>({transform:[{rotate:`${K.value*180}deg`}],opacity:E(K.value,[0,1],[1,0.8],D.CLAMP)}));return y(H.Provider,{value:"native:text-lg font-medium web:group-hover:underline",children:y(f.Header,{className:"flex",children:y(f.Trigger,{...q,asChild:!0,children:v(g,{className:z("group flex web:flex-1 flex-row items-center justify-between py-4 web:transition-all web:focus-visible:outline-hidden web:focus-visible:ring-1 web:focus-visible:ring-muted-foreground",W),children:[M,y(J.View,{style:L,children:y(Q,{size:18,className:"shrink-0 text-foreground"})})]})})})})}function e({className:W,children:M,...q}){let{isExpanded:B}=f.useItemContext();return y(H.Provider,{value:"native:text-lg",children:y(f.Content,{className:z("overflow-hidden text-sm web:transition-all",B?"web:animate-accordion-down":"web:animate-accordion-up"),...q,children:y(u,{className:z("pb-4",W),children:M})})})}function u({children:W,className:M}){if(X.OS==="web")return y($,{className:z("pb-4",M),children:W});return y(J.View,{entering:F,exiting:b.duration(200),className:z("pb-4",M),children:W})}export{a as AccordionTrigger,n as AccordionItem,e as AccordionContent,i as Accordion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as I}from"@contractspec/lib.ui-kit-core/utils";import*as Z from"@rn-primitives/slot";import*as S from"react";import{Text as R}from"react-native";import{jsx as W}from"react/jsx-runtime";var Q=S.createContext(void 0);function T({className:q,asChild:G=!1,...K}){let M=S.useContext(Q);return W(G?Z.Text:R,{className:I("web:select-text text-base text-foreground",M,q),...K})}import{cn as w}from"@contractspec/lib.ui-kit-core/utils";import{cva as $}from"class-variance-authority";import{Pressable as f}from"react-native";import{jsx as _}from"react/jsx-runtime";var U=$("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),X=$("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function j({ref:q,className:G,variant:K,size:M,...Y}){return _(Q.Provider,{value:X({variant:K,size:M,className:"web:pointer-events-none"}),children:_(f,{className:w(Y.disabled&&"web:pointer-events-none opacity-50",U({variant:K,size:M,className:G})),ref:q,role:"button",...Y})})}import{cn as L}from"@contractspec/lib.ui-kit-core/utils";import*as E from"@rn-primitives/alert-dialog";import{Platform as k,View as B}from"react-native";import F,{FadeIn as H,FadeOut as z}from"react-native-reanimated";import{jsx as J}from"react/jsx-runtime";var i=E.Root,o=E.Trigger,P=E.Portal;function h({className:q,...G}){let{open:K}=E.useRootContext();return J(E.Overlay,{className:L("absolute top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/80 p-2",K?"web:fade-in-0 web:animate-in":"web:fade-out-0 web:animate-out",q),...G})}function y({className:q,children:G,...K}){return J(E.Overlay,{className:L("absolute top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/80 p-2",q),...K,asChild:!0,children:J(F.View,{entering:H.duration(150),exiting:z.duration(150),children:G})})}var O=k.select({web:h,default:y});function l({className:q,portalHost:G,...K}){let{open:M}=E.useRootContext();return J(P,{hostName:G,children:J(O,{children:J(E.Content,{className:L("z-50 max-w-lg gap-4 rounded-lg border border-border bg-background p-6 shadow-foreground/10 shadow-lg web:duration-200",M?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",q),...K})})})}function r({className:q,...G}){return J(B,{className:L("flex flex-col gap-2",q),...G})}function e({className:q,...G}){return J(B,{className:L("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",q),...G})}function t({className:q,...G}){return J(E.Title,{className:L("font-semibold native:text-xl text-foreground text-lg",q),...G})}function s({className:q,...G}){return J(E.Description,{className:L("native:text-base text-muted-foreground text-sm",q),...G})}function a({className:q,...G}){return J(Q.Provider,{value:X({className:q}),children:J(E.Action,{className:L(U(),q),...G})})}function qq({className:q,...G}){return J(Q.Provider,{value:X({className:q,variant:"outline"}),children:J(E.Cancel,{className:L(U({variant:"outline",className:q})),...G})})}export{o as AlertDialogTrigger,t as AlertDialogTitle,P as AlertDialogPortal,O as AlertDialogOverlay,r as AlertDialogHeader,e as AlertDialogFooter,s as AlertDialogDescription,l as AlertDialogContent,qq as AlertDialogCancel,a as AlertDialogAction,i as AlertDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as Q}from"@contractspec/lib.ui-kit-core/utils";import*as L from"@rn-primitives/slot";import*as B from"react";import{Text as U}from"react-native";import{jsx as X}from"react/jsx-runtime";var W=B.createContext(void 0);function H({className:q,asChild:f=!1,...F}){let G=B.useContext(W);return X(f?L.Text:U,{className:Q("web:select-text text-base text-foreground",G,q),...F})}import{cn as O}from"@contractspec/lib.ui-kit-core/utils";import{useTheme as Y}from"@react-navigation/native";import{cva as Z}from"class-variance-authority";import{View as M}from"react-native";import{jsx as E,jsxs as $}from"react/jsx-runtime";var _=Z("relative w-full rounded-lg border border-border bg-background p-4 shadow-2xs shadow-foreground/10",{variants:{variant:{default:"",destructive:"border-destructive"}},defaultVariants:{variant:"default"}});function A({className:q,variant:f,children:F,icon:G,iconSize:J=16,iconClassName:g,...P}){let{colors:K}=Y();return $(M,{role:"alert",className:_({variant:f,className:q}),...P,children:[E(M,{className:"absolute top-4 left-3.5 -translate-y-0.5",children:E(G,{size:J,color:f==="destructive"?K.notification:K.text})}),F]})}function V({className:q,...f}){return E(H,{className:O("mb-1 pl-7 font-medium text-base text-foreground leading-none tracking-tight",q),...f})}function d({className:q,...f}){return E(H,{className:O("pl-7 text-foreground text-sm leading-relaxed",q),...f})}export{V as AlertTitle,d as AlertDescription,A as Alert};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"@rn-primitives/aspect-ratio";var i=t.Root;export{i as AspectRatio};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as e}from"nativewind";function H(f){e(f,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as K}from"lucide-react-native";H(K);import{cn as d}from"@contractspec/lib.ui-kit-core/utils";import*as B from"@rn-primitives/slot";import*as L from"react";import{Text as l}from"react-native";import{jsx as x}from"react/jsx-runtime";var t=L.createContext(void 0);function Q({className:f,asChild:W=!1,...T}){let u=L.useContext(t);return x(W?B.Text:l,{className:d("web:select-text text-base text-foreground",u,f),...T})}import{cn as C}from"@contractspec/lib.ui-kit-core/utils";import*as X from"@rn-primitives/label";import{Platform as V}from"react-native";import{jsx as S}from"react/jsx-runtime";function v({className:f,onPress:W,onLongPress:T,onPressIn:u,onPressOut:I,disabled:M,...$}){return S(X.Root,{className:C("flex select-none flex-row items-center gap-2",V.select({web:"cursor-default leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50"}),M&&"opacity-50"),onPress:W,onLongPress:T,onPressIn:u,onPressOut:I,disabled:M,children:S(X.Text,{className:C("font-medium text-foreground text-sm",V.select({web:"leading-none"}),f),...$})})}import{Check as Y}from"lucide-react-native";H(Y);import{ChevronUp as Z}from"lucide-react-native";H(Z);import{cn as z}from"@contractspec/lib.ui-kit-core/utils";import*as m from"@rn-primitives/select";import{Platform as _,StyleSheet as r,View as o}from"react-native";import j,{FadeIn as c,FadeOut as i}from"react-native-reanimated";import{jsx as F,jsxs as A}from"react/jsx-runtime";var P=m.Root,km=m.Group,N=m.Value;function h({ref:f,className:W,children:T,...u}){return A(m.Trigger,{ref:f,className:z("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",u.disabled&&"web:cursor-not-allowed opacity-50",W),...u,children:[T,F(K,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function n({className:f,...W}){if(_.OS!=="web")return null;return F(m.ScrollUpButton,{className:z("flex web:cursor-default items-center justify-center py-1",f),...W,children:F(Z,{size:14,className:"text-foreground"})})}function p({className:f,...W}){if(_.OS!=="web")return null;return F(m.ScrollDownButton,{className:z("flex web:cursor-default items-center justify-center py-1",f),...W,children:F(K,{size:14,className:"text-foreground"})})}function w({className:f,children:W,position:T="popper",portalHost:u,...I}){let{open:M}=m.useRootContext();return F(m.Portal,{hostName:u,children:F(m.Overlay,{style:_.OS!=="web"?r.absoluteFill:void 0,children:F(j.View,{className:"z-50",entering:c,exiting:i,children:A(m.Content,{className:z("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",T==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",M?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",f),position:T,...I,children:[F(n,{}),F(m.Viewport,{className:z("p-1",T==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:W}),F(p,{})]})})})})}function Dm({className:f,...W}){return F(m.Label,{className:z("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",f),...W})}function y({className:f,children:W,...T}){return A(m.Item,{className:z("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",T.disabled&&"web:pointer-events-none opacity-50",f),...T,children:[F(o,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:F(m.ItemIndicator,{children:F(Y,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),F(m.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function bm({className:f,...W}){return F(m.Separator,{className:z("-mx-1 my-1 h-px bg-muted",f),...W})}import{cn as G}from"@contractspec/lib.ui-kit-core/utils";import{cva as O}from"class-variance-authority";import{View as U}from"react-native";import{jsx as b}from"react/jsx-runtime";var k="flex",a=O([k,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),s=O([k,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),mm=O([k,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function Pm({className:f,spacing:W,align:T,justify:u,width:I,padding:M,gap:$,wrap:q,...R}){return b(U,{className:G(mm({spacing:W,align:T,justify:u,width:I,padding:M,gap:$,wrap:q}),f),...R})}function D({className:f,spacing:W,align:T,justify:u,width:I,padding:M,gap:$,wrap:q,...R}){return b(U,{className:G(s({spacing:W,align:T,justify:u,width:I,padding:M,gap:$,wrap:q}),f),...R})}function Nm({className:f,spacing:W,align:T,justify:u,width:I,padding:M,gap:$,...q}){return b(U,{className:G(a({spacing:W,align:T,justify:u,width:I,padding:M,gap:$}),f),...q})}import{View as fm}from"react-native";import{jsx as J,jsxs as E}from"react/jsx-runtime";var xm=({value:f,options:W,onChange:T,placeholder:u="Sélectionner...",label:I,disabled:M=!1,className:$="",showCounts:q=!1})=>{return E(D,{className:`space-y-2 ${$}`,children:[I&&J(v,{className:"font-medium text-base text-foreground",children:I}),E(P,{value:f,onValueChange:T,disabled:M,children:[J(h,{className:"w-full",children:J(N,{placeholder:u})}),E(w,{className:"bg-background",children:[E(y,{value:"all",label:"Tous",children:[J(Q,{children:"Tous"}),q&&E(fm,{className:"ml-2 text-muted-foreground text-sm",children:["(",W.reduce((R,g)=>R+(g.count||0),0),")"]})]}),W.map((R)=>J(y,{value:R.value,label:R.label,children:E(D,{className:"flex w-full items-center justify-between",children:[J(Q,{children:R.label}),q&&R.count!==void 0&&E(Q,{className:"ml-2 text-muted-foreground text-sm",children:["(",R.count,")"]})]})},R.value))]})]})]})};export{xm as FilterSelect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as g}from"nativewind";function E(f){g(f,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as J}from"lucide-react-native";E(J);import{cn as d}from"@contractspec/lib.ui-kit-core/utils";import*as B from"@rn-primitives/slot";import*as K from"react";import{Text as l}from"react-native";import{jsx as r}from"react/jsx-runtime";var t=K.createContext(void 0);function L({className:f,asChild:F=!1,...W}){let u=K.useContext(t);return r(F?B.Text:l,{className:d("web:select-text text-base text-foreground",u,f),...W})}import{cn as C}from"@contractspec/lib.ui-kit-core/utils";import*as Q from"@rn-primitives/label";import{Platform as V}from"react-native";import{jsx as S}from"react/jsx-runtime";function e({className:f,onPress:F,onLongPress:W,onPressIn:u,onPressOut:y,disabled:I,...R}){return S(Q.Root,{className:C("flex select-none flex-row items-center gap-2",V.select({web:"cursor-default leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50"}),I&&"opacity-50"),onPress:F,onLongPress:W,onPressIn:u,onPressOut:y,disabled:I,children:S(Q.Text,{className:C("font-medium text-foreground text-sm",V.select({web:"leading-none"}),f),...R})})}import{Check as X}from"lucide-react-native";E(X);import{ChevronUp as Y}from"lucide-react-native";E(Y);import{cn as q}from"@contractspec/lib.ui-kit-core/utils";import*as m from"@rn-primitives/select";import{Platform as Z,StyleSheet as x,View as o}from"react-native";import j,{FadeIn as c,FadeOut as i}from"react-native-reanimated";import{jsx as T,jsxs as A}from"react/jsx-runtime";var v=m.Root,Dm=m.Group,P=m.Value;function N({ref:f,className:F,children:W,...u}){return A(m.Trigger,{ref:f,className:q("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",u.disabled&&"web:cursor-not-allowed opacity-50",F),...u,children:[W,T(J,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function p({className:f,...F}){if(Z.OS!=="web")return null;return T(m.ScrollUpButton,{className:q("flex web:cursor-default items-center justify-center py-1",f),...F,children:T(Y,{size:14,className:"text-foreground"})})}function n({className:f,...F}){if(Z.OS!=="web")return null;return T(m.ScrollDownButton,{className:q("flex web:cursor-default items-center justify-center py-1",f),...F,children:T(J,{size:14,className:"text-foreground"})})}function h({className:f,children:F,position:W="popper",portalHost:u,...y}){let{open:I}=m.useRootContext();return T(m.Portal,{hostName:u,children:T(m.Overlay,{style:Z.OS!=="web"?x.absoluteFill:void 0,children:T(j.View,{className:"z-50",entering:c,exiting:i,children:A(m.Content,{className:q("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",W==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",I?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",f),position:W,...y,children:[T(p,{}),T(m.Viewport,{className:q("p-1",W==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:F}),T(n,{})]})})})})}function bm({className:f,...F}){return T(m.Label,{className:q("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",f),...F})}function _({className:f,children:F,...W}){return A(m.Item,{className:q("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",W.disabled&&"web:pointer-events-none opacity-50",f),...W,children:[T(o,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:T(m.ItemIndicator,{children:T(X,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),T(m.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function Bm({className:f,...F}){return T(m.Separator,{className:q("-mx-1 my-1 h-px bg-muted",f),...F})}import{cn as G}from"@contractspec/lib.ui-kit-core/utils";import{cva as O}from"class-variance-authority";import{View as U}from"react-native";import{jsx as b}from"react/jsx-runtime";var k="flex",a=O([k,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),s=O([k,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),mm=O([k,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function Pm({className:f,spacing:F,align:W,justify:u,width:y,padding:I,gap:R,wrap:$,...M}){return b(U,{className:G(mm({spacing:F,align:W,justify:u,width:y,padding:I,gap:R,wrap:$}),f),...M})}function D({className:f,spacing:F,align:W,justify:u,width:y,padding:I,gap:R,wrap:$,...M}){return b(U,{className:G(s({spacing:F,align:W,justify:u,width:y,padding:I,gap:R,wrap:$}),f),...M})}function Nm({className:f,spacing:F,align:W,justify:u,width:y,padding:I,gap:R,...$}){return b(U,{className:G(a({spacing:F,align:W,justify:u,width:y,padding:I,gap:R}),f),...$})}import{View as fm}from"react-native";import{jsx as H,jsxs as z}from"react/jsx-runtime";var Fm=({value:f,options:F,onChange:W,placeholder:u="Sélectionner...",label:y,disabled:I=!1,className:R="",showCounts:$=!1})=>{return z(D,{className:`space-y-2 ${R}`,children:[y&&H(e,{className:"font-medium text-base text-foreground",children:y}),z(v,{value:f,onValueChange:W,disabled:I,children:[H(N,{className:"w-full",children:H(P,{placeholder:u})}),z(h,{className:"bg-background",children:[z(_,{value:"all",label:"Tous",children:[H(L,{children:"Tous"}),$&&z(fm,{className:"ml-2 text-muted-foreground text-sm",children:["(",F.reduce((M,w)=>M+(w.count||0),0),")"]})]}),F.map((M)=>H(_,{value:M.value,label:M.label,children:z(D,{className:"flex w-full items-center justify-between",children:[H(L,{children:M.label}),$&&M.count!==void 0&&z(L,{className:"ml-2 text-muted-foreground text-sm",children:["(",M.count,")"]})]})},M.value))]})]})]})};export{Fm as FilterSelect};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as R}from"@contractspec/lib.ui-kit-core/utils";import*as _ from"@rn-primitives/slot";import*as Y from"react";import{Text as U}from"react-native";import{jsx as f}from"react/jsx-runtime";var X=Y.createContext(void 0);function F({className:q,asChild:A=!1,...D}){let E=Y.useContext(X);return f(A?_.Text:U,{className:R("web:select-text text-base text-foreground",E,q),...D})}import{cn as I}from"@contractspec/lib.ui-kit-core/utils";import*as G from"@rn-primitives/slot";import{Platform as $}from"react-native";import{jsx as J}from"react/jsx-runtime";function u({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:"heading","aria-level":"1",className:I("web:select-text web:scroll-m-20 font-extrabold text-4xl text-foreground tracking-tight lg:text-5xl",q),...D})}function T({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:"heading","aria-level":"2",className:I("web:select-text web:scroll-m-20 border-border border-b pb-2 font-semibold text-3xl text-foreground tracking-tight first:mt-0",q),...D})}function h({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:"heading","aria-level":"3",className:I("web:select-text web:scroll-m-20 font-semibold text-2xl text-foreground tracking-tight",q),...D})}function j({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:"heading","aria-level":"4",className:I("web:select-text web:scroll-m-20 font-semibold text-foreground text-xl tracking-tight",q),...D})}function y({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{className:I("web:select-text text-base text-foreground",q),...D})}function C({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:$.OS==="web"?"blockquote":void 0,className:I("mt-6 native:mt-4 web:select-text border-border border-l-2 native:pl-3 pl-6 text-base text-foreground italic",q),...D})}function d({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{role:$.OS==="web"?"code":void 0,className:I("relative web:select-text rounded-md bg-muted px-[0.3rem] py-[0.2rem] font-semibold text-foreground text-sm",q),...D})}function N({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{className:I("web:select-text text-muted-foreground text-xl",q),...D})}function m({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{className:I("web:select-text font-semibold text-foreground text-xl",q),...D})}function n({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{className:I("web:select-text font-medium text-foreground text-sm leading-none",q),...D})}function o({className:q,asChild:A=!1,...D}){return J(A?G.Text:F,{className:I("web:select-text text-muted-foreground text-sm",q),...D})}import{clsx as g}from"clsx";import{twMerge as b}from"tailwind-merge";function O(...q){return b(g(q))}import{Loader2 as z}from"lucide-react";import{View as M}from"react-native";import{jsx as K,jsxs as B}from"react/jsx-runtime";var H={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8",xl:"h-12 w-12"},s=({size:q="md",className:A,text:D,fullScreen:E=!1})=>{let W=B(M,{className:O("flex flex-col items-center justify-center gap-2",A),children:[K(z,{className:O("animate-spin text-primary-600",H[q])}),D&&K(y,{className:"animate-pulse text-base text-gray-600",children:D})]});if(E)return K(M,{className:"fixed inset-0 z-50 flex items-center justify-center bg-white/80 backdrop-blur-xs",children:W});return W},Z=({className:q})=>K(M,{className:O("h-4 animate-pulse rounded-xs bg-gray-200",q)}),qq=({className:q})=>B(M,{className:O("animate-pulse space-y-3 rounded-lg bg-gray-200 p-4",q),children:[K(Z,{className:"h-6 w-3/4"}),K(Z,{className:"h-4 w-full"}),K(Z,{className:"h-4 w-2/3"})]}),Aq=({rows:q=5,cols:A=4})=>K(M,{className:"space-y-3",children:Array.from({length:q}).map((D,E)=>K(M,{className:"flex space-x-4",children:Array.from({length:A}).map((W,Q)=>K(Z,{className:"flex-1"},Q))},E))});export{Aq as SkeletonTable,Z as SkeletonLine,qq as SkeletonCard,s as LoadingSpinner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as SkeletonTable,r as SkeletonLine,l as SkeletonCard,o as LoadingSpinner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as a}from"nativewind";function W(m){a(m,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as H}from"lucide-react-native";W(H);import{cn as p}from"@contractspec/lib.ui-kit-core/utils";import*as D from"@rn-primitives/slot";import*as $ from"react";import{Text as j}from"react-native";import{jsx as s}from"react/jsx-runtime";var G=$.createContext(void 0);function L({className:m,asChild:e=!1,...r}){let u=$.useContext(G);return s(e?D.Text:j,{className:p("web:select-text text-base text-foreground",u,m),...r})}import{cn as ee}from"@contractspec/lib.ui-kit-core/utils";import{cva as v}from"class-variance-authority";import{Pressable as me}from"react-native";import{jsx as o}from"react/jsx-runtime";var fe=v("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),re=v("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function k({ref:m,className:e,variant:r,size:u,...i}){return o(G.Provider,{value:re({variant:r,size:u,className:"web:pointer-events-none"}),children:o(me,{className:ee(i.disabled&&"web:pointer-events-none opacity-50",fe({variant:r,size:u,className:e})),ref:m,role:"button",...i})})}import{Check as _}from"lucide-react-native";W(_);import{ChevronUp as n}from"lucide-react-native";W(n);import{cn as I}from"@contractspec/lib.ui-kit-core/utils";import*as f from"@rn-primitives/select";import{Platform as q,StyleSheet as ue,View as be}from"react-native";import ie,{FadeIn as ye,FadeOut as de}from"react-native-reanimated";import{jsx as y,jsxs as B}from"react/jsx-runtime";var U=f.Root,Pe=f.Group,S=f.Value;function V({ref:m,className:e,children:r,...u}){return B(f.Trigger,{ref:m,className:I("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",u.disabled&&"web:cursor-not-allowed opacity-50",e),...u,children:[r,y(H,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function he({className:m,...e}){if(q.OS!=="web")return null;return y(f.ScrollUpButton,{className:I("flex web:cursor-default items-center justify-center py-1",m),...e,children:y(n,{size:14,className:"text-foreground"})})}function le({className:m,...e}){if(q.OS!=="web")return null;return y(f.ScrollDownButton,{className:I("flex web:cursor-default items-center justify-center py-1",m),...e,children:y(H,{size:14,className:"text-foreground"})})}function w({className:m,children:e,position:r="popper",portalHost:u,...i}){let{open:h}=f.useRootContext();return y(f.Portal,{hostName:u,children:y(f.Overlay,{style:q.OS!=="web"?ue.absoluteFill:void 0,children:y(ie.View,{className:"z-50",entering:ye,exiting:de,children:B(f.Content,{className:I("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",r==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",h?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",m),position:r,...i,children:[y(he,{}),y(f.Viewport,{className:I("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:e}),y(le,{})]})})})})}function ge({className:m,...e}){return y(f.Label,{className:I("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",m),...e})}function C({className:m,children:e,...r}){return B(f.Item,{className:I("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",r.disabled&&"web:pointer-events-none opacity-50",m),...r,children:[y(be,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:y(f.ItemIndicator,{children:y(_,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),y(f.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function ce({className:m,...e}){return y(f.Separator,{className:I("-mx-1 my-1 h-px bg-muted",m),...e})}import{cn as E}from"@contractspec/lib.ui-kit-core/utils";import{cva as J}from"class-variance-authority";import{View as K}from"react-native";import{jsx as Y}from"react/jsx-runtime";var Q="flex",Le=J([Q,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),Me=J([Q,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),Ne=J([Q,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function em({className:m,spacing:e,align:r,justify:u,width:i,padding:h,gap:l,wrap:T,...A}){return Y(K,{className:E(Ne({spacing:e,align:r,justify:u,width:i,padding:h,gap:l,wrap:T}),m),...A})}function R({className:m,spacing:e,align:r,justify:u,width:i,padding:h,gap:l,wrap:T,...A}){return Y(K,{className:E(Me({spacing:e,align:r,justify:u,width:i,padding:h,gap:l,wrap:T}),m),...A})}function X({className:m,spacing:e,align:r,justify:u,width:i,padding:h,gap:l,...T}){return Y(K,{className:E(Le({spacing:e,align:r,justify:u,width:i,padding:h,gap:l}),m),...T})}import{ChevronLeft as Ie,ChevronRight as Te,ChevronsLeft as We,ChevronsRight as ke}from"lucide-react-native";import{jsx as b,jsxs as M}from"react/jsx-runtime";function Ae(m,e){if(e<=7)return Array.from({length:e},(r,u)=>u+1);if(m<=3)return[1,2,3,4,5,"end-ellipsis",e];if(m>=e-2)return[1,"start-ellipsis",e-4,e-3,e-2,e-1,e];return[1,"start-ellipsis",m-1,m,m+1,"end-ellipsis",e]}var dm=({currentPage:m,totalPages:e,totalItems:r,itemsPerPage:u,onPageChange:i,onItemsPerPageChange:h,disabled:l=!1,className:T="",showItemsPerPage:A=!0,itemsPerPageOptions:P=[10,25,50,100]})=>{if(e<=0)return null;let z=Math.max(0,r),Z=Math.max(1,u),N=Math.min(Math.max(m,1),e),g=z===0?0:(N-1)*Z+1,c=z===0?0:Math.min(N*Z,z),F=N>1&&!l,O=N<e&&!l,x=Ae(N,e);return M(X,{align:"center",gap:"md",justify:"between",className:`sm:flex-row ${T}`,children:[b(X,{className:"order-2 text-base text-muted-foreground sm:order-1",children:M(L,{children:["Affichage de ",g," à ",c," sur ",z," résultats"]})}),M(R,{align:"center",gap:"sm",className:"order-1 sm:order-2",children:[M(k,{variant:"outline",size:"sm",onPress:()=>i(1),disabled:!F,accessibilityLabel:"Première page",className:"hidden h-8 w-8 p-0 sm:flex",children:[b(We,{className:"h-4 w-4"}),b(L,{className:"sr-only",children:"Première page"})]}),M(k,{variant:"outline",size:"sm",onPress:()=>i(N-1),disabled:!F,accessibilityLabel:"Page précédente",className:"h-8 w-8 p-0",children:[b(Ie,{className:"h-4 w-4"}),b(L,{className:"sr-only",children:"Page précédente"})]}),b(R,{align:"center",gap:"xs",children:x.map((d)=>{if(typeof d!=="number")return b(R,{className:"px-2 py-1 text-muted-foreground",children:b(L,{children:"..."})},d);return b(k,{variant:d===N?"default":"outline",size:"sm",onPress:()=>i(d),disabled:l,accessibilityLabel:`Page ${d}`,className:"h-8 min-w-8 px-2",children:b(L,{children:d})},d)})}),M(k,{variant:"outline",size:"sm",onPress:()=>i(N+1),disabled:!O,accessibilityLabel:"Page suivante",className:"h-8 w-8 p-0",children:[b(Te,{className:"h-4 w-4"}),b(L,{className:"sr-only",children:"Page suivante"})]}),M(k,{variant:"outline",size:"sm",onPress:()=>i(e),disabled:!O,accessibilityLabel:"Dernière page",className:"hidden h-8 w-8 p-0 sm:flex",children:[b(ke,{className:"h-4 w-4"}),b(L,{className:"sr-only",children:"Dernière page"})]})]}),A&&h&&M(R,{align:"center",gap:"sm",className:"order-3 text-base",children:[b(L,{className:"text-muted-foreground",children:"Afficher:"}),M(U,{value:{value:u.toString(),label:u.toString()},onValueChange:(d)=>{let t=parseInt(d?.value??"",10);if(!Number.isNaN(t)&&t>0)h(t)},disabled:l,children:[b(V,{className:"h-8 w-16",children:b(S,{placeholder:"Afficher:"})}),b(w,{className:"bg-background",children:P.map((d)=>b(C,{value:d.toString(),label:d.toString(),children:d},d))})]})]})]})};export{dm as Pagination};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as a}from"nativewind";function o(m){a(m,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as A}from"lucide-react-native";o(A);import{cn as p}from"@contractspec/lib.ui-kit-core/utils";import*as O from"@rn-primitives/slot";import*as R from"react";import{Text as j}from"react-native";import{jsx as s}from"react/jsx-runtime";var H=R.createContext(void 0);function L({className:m,asChild:e=!1,...r}){let i=R.useContext(H);return s(e?O.Text:j,{className:p("web:select-text text-base text-foreground",i,m),...r})}import{cn as ee}from"@contractspec/lib.ui-kit-core/utils";import{cva as v}from"class-variance-authority";import{Pressable as me}from"react-native";import{jsx as D}from"react/jsx-runtime";var fe=v("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),re=v("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function I({ref:m,className:e,variant:r,size:i,...b}){return D(H.Provider,{value:re({variant:r,size:i,className:"web:pointer-events-none"}),children:D(me,{className:ee(b.disabled&&"web:pointer-events-none opacity-50",fe({variant:r,size:i,className:e})),ref:m,role:"button",...b})})}import{Check as $}from"lucide-react-native";o($);import{ChevronUp as G}from"lucide-react-native";o(G);import{cn as N}from"@contractspec/lib.ui-kit-core/utils";import*as f from"@rn-primitives/select";import{Platform as _,StyleSheet as ie,View as ue}from"react-native";import be,{FadeIn as ye,FadeOut as de}from"react-native-reanimated";import{jsx as y,jsxs as q}from"react/jsx-runtime";var P=f.Root,ge=f.Group,U=f.Value;function S({ref:m,className:e,children:r,...i}){return q(f.Trigger,{ref:m,className:N("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",i.disabled&&"web:cursor-not-allowed opacity-50",e),...i,children:[r,y(A,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function he({className:m,...e}){if(_.OS!=="web")return null;return y(f.ScrollUpButton,{className:N("flex web:cursor-default items-center justify-center py-1",m),...e,children:y(G,{size:14,className:"text-foreground"})})}function le({className:m,...e}){if(_.OS!=="web")return null;return y(f.ScrollDownButton,{className:N("flex web:cursor-default items-center justify-center py-1",m),...e,children:y(A,{size:14,className:"text-foreground"})})}function V({className:m,children:e,position:r="popper",portalHost:i,...b}){let{open:h}=f.useRootContext();return y(f.Portal,{hostName:i,children:y(f.Overlay,{style:_.OS!=="web"?ie.absoluteFill:void 0,children:y(be.View,{className:"z-50",entering:ye,exiting:de,children:q(f.Content,{className:N("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",r==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",h?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",m),position:r,...b,children:[y(he,{}),y(f.Viewport,{className:N("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:e}),y(le,{})]})})})})}function ce({className:m,...e}){return y(f.Label,{className:N("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",m),...e})}function w({className:m,children:e,...r}){return q(f.Item,{className:N("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",r.disabled&&"web:pointer-events-none opacity-50",m),...r,children:[y(ue,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:y(f.ItemIndicator,{children:y($,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),y(f.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function xe({className:m,...e}){return y(f.Separator,{className:N("-mx-1 my-1 h-px bg-muted",m),...e})}import{cn as B}from"@contractspec/lib.ui-kit-core/utils";import{cva as E}from"class-variance-authority";import{View as J}from"react-native";import{jsx as X}from"react/jsx-runtime";var K="flex",Le=E([K,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),te=E([K,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),Me=E([K,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function mm({className:m,spacing:e,align:r,justify:i,width:b,padding:h,gap:l,wrap:n,...T}){return X(J,{className:B(Me({spacing:e,align:r,justify:i,width:b,padding:h,gap:l,wrap:n}),m),...T})}function W({className:m,spacing:e,align:r,justify:i,width:b,padding:h,gap:l,wrap:n,...T}){return X(J,{className:B(te({spacing:e,align:r,justify:i,width:b,padding:h,gap:l,wrap:n}),m),...T})}function Q({className:m,spacing:e,align:r,justify:i,width:b,padding:h,gap:l,...n}){return X(J,{className:B(Le({spacing:e,align:r,justify:i,width:b,padding:h,gap:l}),m),...n})}import{ChevronLeft as Ne,ChevronRight as ne,ChevronsLeft as oe,ChevronsRight as Ie}from"lucide-react-native";import{jsx as u,jsxs as t}from"react/jsx-runtime";function Te(m,e){if(e<=7)return Array.from({length:e},(r,i)=>i+1);if(m<=3)return[1,2,3,4,5,"end-ellipsis",e];if(m>=e-2)return[1,"start-ellipsis",e-4,e-3,e-2,e-1,e];return[1,"start-ellipsis",m-1,m,m+1,"end-ellipsis",e]}var We=({currentPage:m,totalPages:e,totalItems:r,itemsPerPage:i,onPageChange:b,onItemsPerPageChange:h,disabled:l=!1,className:n="",showItemsPerPage:T=!0,itemsPerPageOptions:C=[10,25,50,100]})=>{if(e<=0)return null;let k=Math.max(0,r),Y=Math.max(1,i),M=Math.min(Math.max(m,1),e),g=k===0?0:(M-1)*Y+1,c=k===0?0:Math.min(M*Y,k),Z=M>1&&!l,F=M<e&&!l,x=Te(M,e);return t(Q,{align:"center",gap:"md",justify:"between",className:`sm:flex-row ${n}`,children:[u(Q,{className:"order-2 text-base text-muted-foreground sm:order-1",children:t(L,{children:["Affichage de ",g," à ",c," sur ",k," résultats"]})}),t(W,{align:"center",gap:"sm",className:"order-1 sm:order-2",children:[t(I,{variant:"outline",size:"sm",onPress:()=>b(1),disabled:!Z,accessibilityLabel:"Première page",className:"hidden h-8 w-8 p-0 sm:flex",children:[u(oe,{className:"h-4 w-4"}),u(L,{className:"sr-only",children:"Première page"})]}),t(I,{variant:"outline",size:"sm",onPress:()=>b(M-1),disabled:!Z,accessibilityLabel:"Page précédente",className:"h-8 w-8 p-0",children:[u(Ne,{className:"h-4 w-4"}),u(L,{className:"sr-only",children:"Page précédente"})]}),u(W,{align:"center",gap:"xs",children:x.map((d)=>{if(typeof d!=="number")return u(W,{className:"px-2 py-1 text-muted-foreground",children:u(L,{children:"..."})},d);return u(I,{variant:d===M?"default":"outline",size:"sm",onPress:()=>b(d),disabled:l,accessibilityLabel:`Page ${d}`,className:"h-8 min-w-8 px-2",children:u(L,{children:d})},d)})}),t(I,{variant:"outline",size:"sm",onPress:()=>b(M+1),disabled:!F,accessibilityLabel:"Page suivante",className:"h-8 w-8 p-0",children:[u(ne,{className:"h-4 w-4"}),u(L,{className:"sr-only",children:"Page suivante"})]}),t(I,{variant:"outline",size:"sm",onPress:()=>b(e),disabled:!F,accessibilityLabel:"Dernière page",className:"hidden h-8 w-8 p-0 sm:flex",children:[u(Ie,{className:"h-4 w-4"}),u(L,{className:"sr-only",children:"Dernière page"})]})]}),T&&h&&t(W,{align:"center",gap:"sm",className:"order-3 text-base",children:[u(L,{className:"text-muted-foreground",children:"Afficher:"}),t(P,{value:{value:i.toString(),label:i.toString()},onValueChange:(d)=>{let z=parseInt(d?.value??"",10);if(!Number.isNaN(z)&&z>0)h(z)},disabled:l,children:[u(S,{className:"h-8 w-16",children:u(U,{placeholder:"Afficher:"})}),u(V,{className:"bg-background",children:C.map((d)=>u(w,{value:d.toString(),label:d.toString(),children:d},d))})]})]})]})};export{We as Pagination};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as A}from"@contractspec/lib.ui-kit-core/utils";import*as S from"@rn-primitives/slot";import*as g from"react";import{Text as D}from"react-native";import{jsx as G}from"react/jsx-runtime";var y=g.createContext(void 0);function r({className:f,asChild:m=!1,...e}){let h=g.useContext(y);return G(m?S.Text:D,{className:A("web:select-text text-base text-foreground",h,f),...e})}import{cn as H}from"@contractspec/lib.ui-kit-core/utils";import{cva as I}from"class-variance-authority";import{Pressable as J}from"react-native";import{jsx as E}from"react/jsx-runtime";var K=I("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),L=I("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function P({ref:f,className:m,variant:e,size:h,...o}){return E(y.Provider,{value:L({variant:e,size:h,className:"web:pointer-events-none"}),children:E(J,{className:H(o.disabled&&"web:pointer-events-none opacity-50",K({variant:e,size:h,className:m})),ref:f,role:"button",...o})})}import{cn as R}from"@contractspec/lib.ui-kit-core/utils";import{TextInput as M}from"react-native";import{jsx as O}from"react/jsx-runtime";function B({className:f,placeholderClassName:m,...e}){return O(M,{className:R("web:flex h-10 native:h-12 web:w-full rounded-md border border-input bg-background px-3 web:py-2 native:text-lg text-base text-foreground native:leading-tight web:ring-offset-background file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 lg:text-sm",e.editable===!1&&"web:cursor-not-allowed opacity-50",f),placeholderClassName:R("text-muted-foreground",m),...e})}import{Search as Q,X as U}from"lucide-react";import{View as d}from"react-native";import{jsx as w,jsxs as F}from"react/jsx-runtime";var j=({value:f,onChange:m,placeholder:e="Rechercher...",onClear:h,disabled:o=!1,className:X=""})=>{let $=()=>{m(""),h?.()};return F(d,{className:`relative w-full ${X}`,children:[w(d,{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:w(Q,{className:"h-4 w-4 text-muted-foreground"})}),w(B,{value:f,onChange:(q)=>m(q.nativeEvent.text),placeholder:e,editable:!o,className:"pr-10 pl-10"}),f&&w(d,{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:F(P,{variant:"ghost",size:"sm",onPress:$,disabled:o,className:"h-6 w-6 p-0 hover:bg-transparent",children:[w(U,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),w(r,{className:"sr-only",children:"Effacer la recherche"})]})})]})};export{j as SearchInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as q}from"@contractspec/lib.ui-kit-core/utils";import*as S from"@rn-primitives/slot";import*as w from"react";import{Text as u}from"react-native";import{jsx as A}from"react/jsx-runtime";var y=w.createContext(void 0);function p({className:f,asChild:m=!1,...e}){let o=w.useContext(y);return A(m?S.Text:u,{className:q("web:select-text text-base text-foreground",o,f),...e})}import{cn as D}from"@contractspec/lib.ui-kit-core/utils";import{cva as I}from"class-variance-authority";import{Pressable as G}from"react-native";import{jsx as d}from"react/jsx-runtime";var H=I("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),J=I("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function P({ref:f,className:m,variant:e,size:o,...h}){return d(y.Provider,{value:J({variant:e,size:o,className:"web:pointer-events-none"}),children:d(G,{className:D(h.disabled&&"web:pointer-events-none opacity-50",H({variant:e,size:o,className:m})),ref:f,role:"button",...h})})}import{cn as E}from"@contractspec/lib.ui-kit-core/utils";import{TextInput as K}from"react-native";import{jsx as L}from"react/jsx-runtime";function R({className:f,placeholderClassName:m,...e}){return L(K,{className:E("web:flex h-10 native:h-12 web:w-full rounded-md border border-input bg-background px-3 web:py-2 native:text-lg text-base text-foreground native:leading-tight web:ring-offset-background file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 lg:text-sm",e.editable===!1&&"web:cursor-not-allowed opacity-50",f),placeholderClassName:E("text-muted-foreground",m),...e})}import{Search as M,X as O}from"lucide-react";import{View as g}from"react-native";import{jsx as r,jsxs as B}from"react/jsx-runtime";var Q=({value:f,onChange:m,placeholder:e="Rechercher...",onClear:o,disabled:h=!1,className:F=""})=>{let X=()=>{m(""),o?.()};return B(g,{className:`relative w-full ${F}`,children:[r(g,{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:r(M,{className:"h-4 w-4 text-muted-foreground"})}),r(R,{value:f,onChange:($)=>m($.nativeEvent.text),placeholder:e,editable:!h,className:"pr-10 pl-10"}),f&&r(g,{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:B(P,{variant:"ghost",size:"sm",onPress:X,disabled:h,className:"h-6 w-6 p-0 hover:bg-transparent",children:[r(O,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),r(p,{className:"sr-only",children:"Effacer la recherche"})]})})]})};export{Q as SearchInput};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as q}from"@contractspec/lib.ui-kit-core/utils";import*as d from"@rn-primitives/avatar";import{jsx as w}from"react/jsx-runtime";function B({className:f,...h}){return w(d.Root,{className:q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",f),...h})}function C({className:f,alt:h,...y}){return w(d.Image,{className:q("aspect-square h-full w-full",f),...y})}function D({className:f,...h}){return w(d.Fallback,{className:q("flex h-full w-full items-center justify-center rounded-full bg-muted",f),...h})}export{C as AvatarImage,D as AvatarFallback,B as Avatar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as A}from"@contractspec/lib.ui-kit-core/utils";import{cva as C}from"class-variance-authority";import{View as D}from"react-native";import{jsx as F}from"react/jsx-runtime";var E=C("web:inline-flex items-center rounded-full border border-border px-2.5 py-0.5 font-semibold text-xs web:transition-colors web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground web:hover:opacity-80 active:opacity-80",secondary:"border-transparent bg-secondary text-secondary-foreground web:hover:opacity-80 active:opacity-80",destructive:"border-transparent bg-destructive text-destructive-foreground web:hover:opacity-80 active:opacity-80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function K({className:f,variant:q,labelClassName:G,...z}){return F(D,{className:A(E({variant:q}),f),...z})}export{E as badgeVariants,K as Badge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as D}from"@contractspec/lib.ui-kit-core/utils";import{ChevronRight as G,MoreHorizontal as J}from"lucide-react";import{Text as K,View as A}from"react-native";import{jsx as y,jsxs as O}from"react/jsx-runtime";function X({...f}){return y("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...f})}function Y({className:f,...q}){return y(A,{"data-slot":"breadcrumb-list",className:D("flex flex-wrap items-center gap-1.5 break-words text-muted-foreground text-sm sm:gap-2.5",f),...q})}function Z({className:f,...q}){return y(A,{"data-slot":"breadcrumb-item",className:D("inline-flex items-center gap-1.5",f),...q})}function _({asChild:f,className:q,...F}){return y(A,{"data-slot":"breadcrumb-link",className:D("transition-colors hover:text-foreground",q),...F})}function $({className:f,...q}){return y(A,{"data-slot":"breadcrumb-page",role:"link","aria-disabled":!0,"aria-current":"page",className:D("font-normal text-foreground",f),...q})}function z({children:f,className:q,...F}){return y(A,{role:"presentation","data-slot":"breadcrumb-separator","aria-hidden":!0,className:D("[&>svg]:size-3.5",q),...F,children:f??y(G,{})})}function C({className:f,...q}){return O(A,{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":!0,className:D("flex size-9 items-center justify-center",f),...q,children:[y(J,{className:"size-4"}),y(A,{className:"sr-only",children:y(K,{children:"More"})})]})}export{z as BreadcrumbSeparator,$ as BreadcrumbPage,Y as BreadcrumbList,_ as BreadcrumbLink,Z as BreadcrumbItem,C as BreadcrumbEllipsis,X as Breadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as J}from"@contractspec/lib.ui-kit-core/utils";import*as G from"@rn-primitives/slot";import*as w from"react";import{Text as K}from"react-native";import{jsx as L}from"react/jsx-runtime";var F=w.createContext(void 0);function X({className:A,asChild:D=!1,...g}){let q=w.useContext(F);return L(D?G.Text:K,{className:J("web:select-text text-base text-foreground",q,A),...g})}import{cn as M}from"@contractspec/lib.ui-kit-core/utils";import{cva as I}from"class-variance-authority";import{Pressable as O}from"react-native";import{jsx as H}from"react/jsx-runtime";var Q=I("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),S=I("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function P({ref:A,className:D,variant:g,size:q,...E}){return H(F.Provider,{value:S({variant:g,size:q,className:"web:pointer-events-none"}),children:H(O,{className:M(E.disabled&&"web:pointer-events-none opacity-50",Q({variant:g,size:q,className:D})),ref:A,role:"button",...E})})}export{Q as buttonVariants,S as buttonTextVariants,P as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as K}from"@contractspec/lib.ui-kit-core/utils";import*as E from"@rn-primitives/slot";import*as z from"react";import{Text as L}from"react-native";import{jsx as M}from"react/jsx-runtime";var B=z.createContext(void 0);function S({className:f,asChild:g=!1,...I}){let J=z.useContext(B);return M(g?E.Text:L,{className:K("web:select-text text-base text-foreground",J,f),...I})}import{cn as y}from"@contractspec/lib.ui-kit-core/utils";import{Text as G,View as A}from"react-native";import{jsx as q}from"react/jsx-runtime";function _({className:f,...g}){return q(A,{className:y("rounded-lg border border-border bg-card shadow-2xs shadow-foreground/10",f),...g})}function $({className:f,...g}){return q(A,{className:y("flex flex-col gap-y-1.5 p-6",f),...g})}function D({className:f,...g}){return q(G,{role:"heading","aria-level":3,className:y("font-semibold text-2xl text-card-foreground leading-none tracking-tight",f),...g})}function F({className:f,...g}){return q(G,{className:y("text-muted-foreground text-sm",f),...g})}function H({className:f,...g}){return q(B.Provider,{value:"text-card-foreground",children:q(A,{className:y("p-6 pt-0",f),...g})})}function R({className:f,...g}){return q(A,{className:y("flex flex-row items-center p-6 pt-0",f),...g})}export{D as CardTitle,$ as CardHeader,R as CardFooter,F as CardDescription,H as CardContent,_ as Card};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="null";export{l as carousel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as w}from"@contractspec/lib.ui-kit-core/utils";import*as g from"@rn-primitives/checkbox";import{Check as D}from"lucide-react-native";import*as y from"react";import{jsx as q}from"react/jsx-runtime";var E=y.forwardRef(({className:z,...A},B)=>q(g.Root,{ref:B,className:w("web:peer h-4 w-4 shrink-0 rounded-xs border border-primary web:ring-offset-background web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",z),...A,children:q(g.Indicator,{className:w("flex items-center justify-center text-current"),children:q(D,{className:"h-4 w-4"})})}));E.displayName=g.Root.displayName;export{E as Checkbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as i from"@rn-primitives/collapsible";var l=i.Root,o=i.Trigger,e=i.Content;export{o as CollapsibleTrigger,e as CollapsibleContent,l as Collapsible};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as V}from"nativewind";function t(b){V(b,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as v}from"lucide-react-native";t(v);import{Check as C}from"lucide-react-native";t(C);import{ChevronUp as r}from"lucide-react-native";t(r);import{cn as i}from"@contractspec/lib.ui-kit-core/utils";import*as e from"@rn-primitives/select";import{Platform as W,StyleSheet as k,View as q}from"react-native";import z,{FadeIn as E,FadeOut as J}from"react-native-reanimated";import{jsx as d,jsxs as O}from"react/jsx-runtime";var T=e.Root,_=e.Group,G=e.Value;function I({ref:b,className:l,children:u,...f}){return O(e.Trigger,{ref:b,className:i("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",f.disabled&&"web:cursor-not-allowed opacity-50",l),...f,children:[u,d(v,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function K({className:b,...l}){if(W.OS!=="web")return null;return d(e.ScrollUpButton,{className:i("flex web:cursor-default items-center justify-center py-1",b),...l,children:d(r,{size:14,className:"text-foreground"})})}function P({className:b,...l}){if(W.OS!=="web")return null;return d(e.ScrollDownButton,{className:i("flex web:cursor-default items-center justify-center py-1",b),...l,children:d(v,{size:14,className:"text-foreground"})})}function L({className:b,children:l,position:u="popper",portalHost:f,...a}){let{open:o}=e.useRootContext();return d(e.Portal,{hostName:f,children:d(e.Overlay,{style:W.OS!=="web"?k.absoluteFill:void 0,children:d(z.View,{className:"z-50",entering:E,exiting:J,children:O(e.Content,{className:i("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",u==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",o?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",b),position:u,...a,children:[d(K,{}),d(e.Viewport,{className:i("p-1",u==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:l}),d(P,{})]})})})})}function p({className:b,...l}){return d(e.Label,{className:i("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",b),...l})}function h({className:b,children:l,...u}){return O(e.Item,{className:i("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",u.disabled&&"web:pointer-events-none opacity-50",b),...u,children:[d(q,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:d(e.ItemIndicator,{children:d(C,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),d(e.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function j({className:b,...l}){return d(e.Separator,{className:i("-mx-1 my-1 h-px bg-muted",b),...l})}import{jsx as m,jsxs as Q}from"react/jsx-runtime";function de({options:b,value:l,onValueChange:u,placeholder:f="Select option",emptyText:a="No option found.",disabled:o,className:M}){let y=b.find((g)=>g.value===l);return Q(T,{value:y?{value:y.value,label:y.label}:void 0,onValueChange:(g)=>{if(g)u?.(g.value)},disabled:o,children:[m(I,{disabled:o,className:M,children:m(G,{placeholder:f})}),m(L,{children:m(_,{children:b.length?b.map((g)=>m(h,{value:g.value,label:g.label,disabled:g.disabled},g.value)):m(h,{value:"__empty",label:a,disabled:!0})})})]})}export{de as Combobox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="null";export{l as carousel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as H}from"nativewind";function B(W){H(W,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as Q}from"lucide-react-native";B(Q);import{cn as I}from"@contractspec/lib.ui-kit-core/utils";import*as G from"@rn-primitives/slot";import*as J from"react";import{Text as g}from"react-native";import{jsx as P}from"react/jsx-runtime";var K=J.createContext(void 0);function T({className:W,asChild:L=!1,...q}){let F=J.useContext(K);return P(L?G.Text:g,{className:I("web:select-text text-base text-foreground",F,W),...q})}import{Check as X}from"lucide-react-native";B(X);import{ChevronUp as Y}from"lucide-react-native";B(Y);import{ChevronRight as Z}from"lucide-react-native";B(Z);import{cn as A}from"@contractspec/lib.ui-kit-core/utils";import*as f from"@rn-primitives/context-menu";import{Platform as $,StyleSheet as _,Text as V,View as D}from"react-native";import{jsx as z,jsxs as U}from"react/jsx-runtime";var e=f.Root,s=f.Trigger,ff=f.Group,Wf=f.Sub,Lf=f.RadioGroup;function qf({className:W,inset:L,children:q,...F}){let{open:E}=f.useSubContext(),O=$.OS==="web"?Z:E?Y:Q;return z(K.Provider,{value:A("select-none native:text-lg text-primary text-sm",E&&"native:text-accent-foreground"),children:U(f.SubTrigger,{className:A("flex web:cursor-default web:select-none flex-row items-center gap-2 rounded-xs px-2 native:py-2 py-1.5 web:outline-hidden web:hover:bg-accent web:focus:bg-accent active:bg-accent",E&&"bg-accent",L&&"pl-8",W),...F,children:[q,z(O,{size:18,className:"ml-auto text-foreground"})]})})}function zf({className:W,...L}){let{open:q}=f.useSubContext();return z(f.SubContent,{className:A("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mt-1 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 shadow-foreground/5 shadow-md",q?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out web:animate-out",W),...L})}function Af({className:W,overlayClassName:L,overlayStyle:q,portalHost:F,...E}){let{open:O}=f.useRootContext();return z(f.Portal,{hostName:F,children:z(f.Overlay,{style:q?_.flatten([$.OS!=="web"?_.absoluteFill:void 0,q]):$.OS!=="web"?_.absoluteFill:void 0,className:L,children:z(f.Content,{className:A("web:data-[side=bottom]:slide-in-from-top-2 web:data-[side=left]:slide-in-from-right-2 web:data-[side=right]:slide-in-from-left-2 web:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 shadow-foreground/5 shadow-md",O?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",W),...E})})})}function Bf({className:W,inset:L,...q}){return z(K.Provider,{value:"select-none text-sm native:text-lg text-popover-foreground web:group-focus:text-accent-foreground",children:z(f.Item,{className:A("group relative flex web:cursor-default flex-row items-center gap-2 rounded-xs px-2 native:py-2 py-1.5 web:outline-hidden web:hover:bg-accent web:focus:bg-accent active:bg-accent",L&&"pl-8",q.disabled&&"web:pointer-events-none opacity-50",W),...q})})}function Ef({className:W,children:L,...q}){return U(f.CheckboxItem,{className:A("web:group relative flex web:cursor-default flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 pl-8 web:outline-hidden web:focus:bg-accent active:bg-accent",q.disabled&&"web:pointer-events-none opacity-50",W),...q,children:[z(D,{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:z(f.ItemIndicator,{children:z(X,{size:14,strokeWidth:3,className:"text-foreground"})})}),L]})}function Ff({className:W,children:L,...q}){return U(f.RadioItem,{className:A("web:group relative flex web:cursor-default flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 pl-8 web:outline-hidden web:focus:bg-accent active:bg-accent",q.disabled&&"web:pointer-events-none opacity-50",W),...q,children:[z(D,{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:z(f.ItemIndicator,{children:z(D,{className:"h-2 w-2 rounded-full bg-foreground"})})}),L]})}function Jf({className:W,inset:L,...q}){return z(f.Label,{className:A("web:cursor-default px-2 py-1.5 font-semibold native:text-base text-foreground text-sm",L&&"pl-8",W),...q})}function Kf({className:W,...L}){return z(f.Separator,{className:A("-mx-1 my-1 h-px bg-border",W),...L})}function Of({className:W,...L}){return z(V,{className:A("ml-auto native:text-sm text-muted-foreground text-xs tracking-widest",W),...L})}export{s as ContextMenuTrigger,qf as ContextMenuSubTrigger,zf as ContextMenuSubContent,Wf as ContextMenuSub,Of as ContextMenuShortcut,Kf as ContextMenuSeparator,Ff as ContextMenuRadioItem,Lf as ContextMenuRadioGroup,Jf as ContextMenuLabel,Bf as ContextMenuItem,ff as ContextMenuGroup,Af as ContextMenuContent,Ef as ContextMenuCheckboxItem,e as ContextMenu};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styled as De}from"nativewind";function S(e){De(e,{className:{target:"style",nativeStyleMapping:{color:!0,opacity:!0}}})}import{ChevronDown as $}from"lucide-react-native";S($);import{cn as Ge}from"@contractspec/lib.ui-kit-core/utils";import*as fe from"@rn-primitives/slot";import*as q from"react";import{Text as _e}from"react-native";import{jsx as qe}from"react/jsx-runtime";var E=q.createContext(void 0);function f({className:e,asChild:t=!1,...n}){let i=q.useContext(E);return qe(t?fe.Text:_e,{className:Ge("web:select-text text-base text-foreground",i,e),...n})}import{cn as Je}from"@contractspec/lib.ui-kit-core/utils";import{cva as be}from"class-variance-authority";import{Pressable as Ke}from"react-native";import{jsx as ue}from"react/jsx-runtime";var Oe=be("group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",{variants:{variant:{default:"bg-primary web:hover:opacity-90 active:opacity-90",destructive:"bg-destructive web:hover:opacity-90 active:opacity-90",outline:"border border-input bg-background web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",secondary:"bg-secondary web:hover:opacity-80 active:opacity-80",ghost:"web:hover:bg-accent web:hover:text-accent-foreground active:bg-accent",link:"web:underline-offset-4 web:hover:underline web:focus:underline"},size:{default:"h-10 native:h-12 native:px-5 px-4 native:py-3 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 native:h-14 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Qe=be("web:whitespace-nowrap font-medium native:text-base text-foreground text-sm web:transition-colors",{variants:{variant:{default:"text-primary-foreground",destructive:"text-destructive-foreground",outline:"group-active:text-accent-foreground",secondary:"text-secondary-foreground group-active:text-secondary-foreground",ghost:"group-active:text-accent-foreground",link:"text-primary group-active:underline"},size:{default:"",sm:"",lg:"native:text-lg",icon:""}},defaultVariants:{variant:"default",size:"default"}});function M({ref:e,className:t,variant:n,size:i,...l}){return ue(E.Provider,{value:Qe({variant:n,size:i,className:"web:pointer-events-none"}),children:ue(Ke,{className:Je(l.disabled&&"web:pointer-events-none opacity-50",Oe({variant:n,size:i,className:t})),ref:e,role:"button",...l})})}import{Check as A}from"lucide-react-native";S(A);import{ChevronUp as X}from"lucide-react-native";S(X);import{cn as L}from"@contractspec/lib.ui-kit-core/utils";import*as m from"@rn-primitives/select";import{Platform as Q,StyleSheet as Ye,View as Ze}from"react-native";import Fe,{FadeIn as Ne,FadeOut as Ue}from"react-native-reanimated";import{jsx as R,jsxs as Y}from"react/jsx-runtime";var Re=m.Root,st=m.Group,Te=m.Value;function Ce({ref:e,className:t,children:n,...i}){return Y(m.Trigger,{ref:e,className:L("flex h-10 native:h-12 flex-row items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-muted-foreground text-sm web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1",i.disabled&&"web:cursor-not-allowed opacity-50",t),...i,children:[n,R($,{size:16,"aria-hidden":!0,className:"text-foreground opacity-50"})]})}function ce({className:e,...t}){if(Q.OS!=="web")return null;return R(m.ScrollUpButton,{className:L("flex web:cursor-default items-center justify-center py-1",e),...t,children:R(X,{size:14,className:"text-foreground"})})}function pe({className:e,...t}){if(Q.OS!=="web")return null;return R(m.ScrollDownButton,{className:L("flex web:cursor-default items-center justify-center py-1",e),...t,children:R($,{size:14,className:"text-foreground"})})}function ge({className:e,children:t,position:n="popper",portalHost:i,...l}){let{open:a}=m.useRootContext();return R(m.Portal,{hostName:i,children:R(m.Overlay,{style:Q.OS!=="web"?Ye.absoluteFill:void 0,children:R(Fe.View,{className:"z-50",entering:Ne,exiting:Ue,children:Y(m.Content,{className:L("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border border-border bg-popover px-1 py-2 shadow-foreground/10 shadow-md",n==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",a?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",e),position:n,...l,children:[R(ce,{}),R(m.Viewport,{className:L("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t}),R(pe,{})]})})})})}function jt({className:e,...t}){return R(m.Label,{className:L("py-1.5 pr-2 native:pb-2 native:pl-10 pl-8 font-semibold native:text-base text-popover-foreground text-sm",e),...t})}function he({className:e,children:t,...n}){return Y(m.Item,{className:L("web:group relative flex w-full web:cursor-default web:select-none flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 native:pl-10 pl-8 web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent active:bg-accent",n.disabled&&"web:pointer-events-none opacity-50",e),...n,children:[R(Ze,{className:"absolute left-2 native:left-3.5 flex h-3.5 w-3.5 items-center justify-center native:pt-px",children:R(m.ItemIndicator,{children:R(A,{size:16,strokeWidth:3,className:"text-popover-foreground"})})}),R(m.ItemText,{className:"native:text-base native:text-lg text-popover-foreground text-sm web:group-focus:text-accent-foreground"})]})}function en({className:e,...t}){return R(m.Separator,{className:L("-mx-1 my-1 h-px bg-muted",e),...t})}import{cn as Z}from"@contractspec/lib.ui-kit-core/utils";import{cva as F}from"class-variance-authority";import{View as N}from"react-native";import{jsx as c}from"react/jsx-runtime";var U="flex",xe=F([U,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),se=F([U,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),je=F([U,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function ln({className:e,spacing:t,align:n,justify:i,width:l,padding:a,gap:d,wrap:b,...y}){return c(N,{className:Z(je({spacing:t,align:n,justify:i,width:l,padding:a,gap:d,wrap:b}),e),...y})}function P({className:e,spacing:t,align:n,justify:i,width:l,padding:a,gap:d,wrap:b,...y}){return c(N,{className:Z(se({spacing:t,align:n,justify:i,width:l,padding:a,gap:d,wrap:b}),e),...y})}function v({className:e,spacing:t,align:n,justify:i,width:l,padding:a,gap:d,...b}){return c(N,{className:Z(xe({spacing:t,align:n,justify:i,width:l,padding:a,gap:d}),e),...b})}import{ChevronLeft as et,ChevronRight as tt,ChevronsLeft as nt,ChevronsRight as it}from"lucide-react-native";import{jsx as u,jsxs as k}from"react/jsx-runtime";function ot(e,t){if(t<=7)return Array.from({length:t},(n,i)=>i+1);if(e<=3)return[1,2,3,4,5,"end-ellipsis",t];if(e>=t-2)return[1,"start-ellipsis",t-4,t-3,t-2,t-1,t];return[1,"start-ellipsis",e-1,e,e+1,"end-ellipsis",t]}var p=({currentPage:e,totalPages:t,totalItems:n,itemsPerPage:i,onPageChange:l,onItemsPerPageChange:a,disabled:d=!1,className:b="",showItemsPerPage:y=!0,itemsPerPageOptions:H=[10,25,50,100]})=>{if(t<=0)return null;let C=Math.max(0,n),_=Math.max(1,i),z=Math.min(Math.max(e,1),t),We=C===0?0:(z-1)*_+1,Ae=C===0?0:Math.min(z*_,C),ae=z>1&&!d,me=z<t&&!d,Xe=ot(z,t);return k(v,{align:"center",gap:"md",justify:"between",className:`sm:flex-row ${b}`,children:[u(v,{className:"order-2 text-base text-muted-foreground sm:order-1",children:k(f,{children:["Affichage de ",We," à ",Ae," sur ",C," résultats"]})}),k(P,{align:"center",gap:"sm",className:"order-1 sm:order-2",children:[k(M,{variant:"outline",size:"sm",onPress:()=>l(1),disabled:!ae,accessibilityLabel:"Première page",className:"hidden h-8 w-8 p-0 sm:flex",children:[u(nt,{className:"h-4 w-4"}),u(f,{className:"sr-only",children:"Première page"})]}),k(M,{variant:"outline",size:"sm",onPress:()=>l(z-1),disabled:!ae,accessibilityLabel:"Page précédente",className:"h-8 w-8 p-0",children:[u(et,{className:"h-4 w-4"}),u(f,{className:"sr-only",children:"Page précédente"})]}),u(P,{align:"center",gap:"xs",children:Xe.map((g)=>{if(typeof g!=="number")return u(P,{className:"px-2 py-1 text-muted-foreground",children:u(f,{children:"..."})},g);return u(M,{variant:g===z?"default":"outline",size:"sm",onPress:()=>l(g),disabled:d,accessibilityLabel:`Page ${g}`,className:"h-8 min-w-8 px-2",children:u(f,{children:g})},g)})}),k(M,{variant:"outline",size:"sm",onPress:()=>l(z+1),disabled:!me,accessibilityLabel:"Page suivante",className:"h-8 w-8 p-0",children:[u(tt,{className:"h-4 w-4"}),u(f,{className:"sr-only",children:"Page suivante"})]}),k(M,{variant:"outline",size:"sm",onPress:()=>l(t),disabled:!me,accessibilityLabel:"Dernière page",className:"hidden h-8 w-8 p-0 sm:flex",children:[u(it,{className:"h-4 w-4"}),u(f,{className:"sr-only",children:"Dernière page"})]})]}),y&&a&&k(P,{align:"center",gap:"sm",className:"order-3 text-base",children:[u(f,{className:"text-muted-foreground",children:"Afficher:"}),k(Re,{value:{value:i.toString(),label:i.toString()},onValueChange:(g)=>{let O=parseInt(g?.value??"",10);if(!Number.isNaN(O)&&O>0)a(O)},disabled:d,children:[u(Ce,{className:"h-8 w-16",children:u(Te,{placeholder:"Afficher:"})}),u(ge,{className:"bg-background",children:H.map((g)=>u(he,{value:g.toString(),label:g.toString(),children:g},g))})]})]})]})};import{cn as Ie}from"@contractspec/lib.ui-kit-core/utils";import*as D from"@rn-primitives/checkbox";import{Check as dt}from"lucide-react-native";import*as Pe from"react";import{jsx as x}from"react/jsx-runtime";var J=Pe.forwardRef(({className:e,...t},n)=>x(D.Root,{ref:n,className:Ie("web:peer h-4 w-4 shrink-0 rounded-xs border border-primary web:ring-offset-background web:focus-visible:outline-hidden web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:x(D.Indicator,{className:Ie("flex items-center justify-center text-current"),children:x(dt,{className:"h-4 w-4"})})}));J.displayName=D.Root.displayName;import{ChevronRight as s}from"lucide-react-native";S(s);import{cn as w}from"@contractspec/lib.ui-kit-core/utils";import*as r from"@rn-primitives/dropdown-menu";import{Platform as ee,StyleSheet as j,Text as rt,View as te}from"react-native";import{jsx as T,jsxs as oe}from"react/jsx-runtime";var we=r.Root,ye=r.Trigger,Wn=r.Group,An=r.Portal,Xn=r.Sub,Dn=r.RadioGroup;function Gn({className:e,inset:t,children:n,...i}){let{open:l}=r.useSubContext(),a=ee.OS==="web"?s:l?X:$;return T(E.Provider,{value:w("select-none native:text-lg text-primary text-sm",l&&"native:text-accent-foreground"),children:oe(r.SubTrigger,{className:w("flex web:cursor-default web:select-none flex-row items-center gap-2 rounded-xs px-2 native:py-2 py-1.5 web:outline-hidden web:hover:bg-accent web:focus:bg-accent active:bg-accent",l&&"bg-accent",t&&"pl-8",e),...i,children:[n,T(a,{size:18,className:"ml-auto text-foreground"})]})})}function _n({className:e,...t}){let{open:n}=r.useSubContext();return T(r.SubContent,{className:w("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mt-1 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 shadow-foreground/5 shadow-md",n?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out web:animate-out",e),...t})}function Me({className:e,overlayClassName:t,overlayStyle:n,portalHost:i,...l}){let{open:a}=r.useRootContext();return T(r.Portal,{hostName:i,children:T(r.Overlay,{style:n?j.flatten([ee.OS!=="web"?j.absoluteFill:void 0,n]):ee.OS!=="web"?j.absoluteFill:void 0,className:t,children:T(r.Content,{className:w("web:data-[side=bottom]:slide-in-from-top-2 web:data-[side=left]:slide-in-from-right-2 web:data-[side=right]:slide-in-from-left-2 web:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 shadow-foreground/5 shadow-md",a?"web:fade-in-0 web:zoom-in-95 web:animate-in":"web:fade-out-0 web:zoom-out-95 web:animate-out",e),...l})})})}function ne({className:e,inset:t,...n}){return T(E.Provider,{value:"select-none text-sm native:text-lg text-popover-foreground web:group-focus:text-accent-foreground",children:T(r.Item,{className:w("group relative flex web:cursor-default flex-row items-center gap-2 rounded-xs px-2 native:py-2 py-1.5 web:outline-hidden web:hover:bg-accent web:focus:bg-accent active:bg-accent",t&&"pl-8",n.disabled&&"web:pointer-events-none opacity-50",e),...n})})}function ke({className:e,children:t,checked:n,...i}){return oe(r.CheckboxItem,{className:w("web:group relative flex web:cursor-default flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 pl-8 web:outline-hidden web:focus:bg-accent active:bg-accent",i.disabled&&"web:pointer-events-none opacity-50",e),checked:n,...i,children:[T(te,{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T(r.ItemIndicator,{children:T(A,{size:14,strokeWidth:3,className:"text-foreground"})})}),t]})}function qn({className:e,children:t,...n}){return oe(r.RadioItem,{className:w("web:group relative flex web:cursor-default flex-row items-center rounded-xs native:py-2 py-1.5 pr-2 pl-8 web:outline-hidden web:focus:bg-accent active:bg-accent",n.disabled&&"web:pointer-events-none opacity-50",e),...n,children:[T(te,{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:T(r.ItemIndicator,{children:T(te,{className:"h-2 w-2 rounded-full bg-foreground"})})}),t]})}function ze({className:e,inset:t,...n}){return T(r.Label,{className:w("web:cursor-default px-2 py-1.5 font-semibold native:text-base text-foreground text-sm",t&&"pl-8",e),...n})}function ie({className:e,...t}){return T(r.Separator,{className:w("-mx-1 my-1 h-px bg-border",e),...t})}function Jn({className:e,...t}){return T(rt,{className:w("ml-auto native:text-sm text-muted-foreground text-xs tracking-widest",e),...t})}import{cn as lt}from"@contractspec/lib.ui-kit-core/utils";import*as Le from"react";import at,{useAnimatedStyle as mt,useSharedValue as ft,withRepeat as ut,withSequence as bt,withTiming as Se}from"react-native-reanimated";import{jsx as Rt}from"react/jsx-runtime";var Ee=1000;function Ve({className:e,...t}){let n=ft(1);Le.useEffect(()=>{n.value=ut(bt(Se(0.5,{duration:Ee}),Se(1,{duration:Ee})),-1)},[]);let i=mt(()=>({opacity:n.value}));return Rt(at.View,{style:i,className:lt("rounded-md bg-secondary dark:bg-muted",e),...t})}import{cn as B}from"@contractspec/lib.ui-kit-core/utils";import*as h from"@rn-primitives/table";import{jsx as V}from"react/jsx-runtime";function He({className:e,...t}){return V(h.Root,{className:B("w-full caption-bottom text-sm",e),...t})}function ve({className:e,...t}){return V(h.Header,{className:B("border-border [&_tr]:border-b",e),...t})}function Be({className:e,style:t,...n}){return V(h.Body,{className:B("flex-1 border-border [&_tr:last-child]:border-0",e),style:[{minHeight:2},t],...n})}function cn({className:e,...t}){return V(h.Footer,{className:B("bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})}function K({className:e,...t}){return V(h.Row,{className:B("flex-row border-border border-b web:transition-colors web:hover:bg-muted/50 web:data-[state=selected]:bg-muted",e),...t})}function $e({className:e,...t}){return V(E.Provider,{value:"text-muted-foreground",children:V(h.Head,{className:B("h-12 justify-center px-4 text-left font-medium [&:has([role=checkbox])]:pr-0",e),...t})})}function de({className:e,...t}){return V(h.Cell,{className:B("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t})}import{ChevronDown as Tt,ChevronRight as Ct,Columns3 as gt}from"lucide-react-native";import*as G from"react";import{ScrollView as ht,View as W}from"react-native";import It from"react-native-reanimated";import{jsx as o,jsxs as I,Fragment as zt}from"react/jsx-runtime";function mi({controller:e,className:t,toolbar:n,footer:i,emptyState:l,loading:a,onRowPress:d}){let b=e.visibleColumns.filter((C)=>C.pinState==="left"),y=e.visibleColumns.filter((C)=>!C.pinState),H=e.visibleColumns.filter((C)=>C.pinState==="right");return I(v,{gap:"md",className:t,children:[I(P,{justify:"between",align:"center",children:[o(W,{children:n}),o(Pt,{columns:e.columns})]}),a?o(v,{gap:"sm",children:Array.from({length:5}).map((C,_)=>o(Ve,{className:"h-12 w-full"},_))}):e.rows.length===0?l??o(W,{className:"rounded-md border border-border border-dashed p-6",children:o(f,{className:"text-center text-muted-foreground",children:"No rows available."})}):o(W,{className:"rounded-md border border-border",children:I(P,{gap:"none",align:"start",wrap:"nowrap",children:[b.length?re(e,b,d):null,o(ht,{horizontal:!0,showsHorizontalScrollIndicator:!1,children:re(e,y,d)}),H.length?re(e,H,d):null]})}),e.pageCount>0?o(p,{currentPage:e.pageIndex+1,totalPages:e.pageCount,totalItems:e.totalItems,itemsPerPage:e.pageSize,onPageChange:(C)=>e.setPageIndex(C-1),onItemsPerPageChange:(C)=>e.setPageSize(C)}):null,i]})}function re(e,t,n){return I(He,{children:[o(ve,{children:o(K,{children:t.map((i)=>o($e,{style:{width:i.size,minWidth:i.size},children:I(P,{gap:"sm",align:"center",justify:"between",wrap:"nowrap",children:[o(W,{children:yt(e,i)}),i.canResize?o(wt,{column:i}):null]})},i.id))})}),o(Be,{children:e.rows.map((i)=>{let l=new Map(i.cells.map((a)=>[a.columnId,a]));return I(v,{gap:"none",children:[o(K,{onPress:()=>n?.(i),children:t.map((a)=>o(de,{style:{width:a.size,minWidth:a.size},children:Mt(i,l.get(a.id))},a.id))}),i.isExpanded&&i.expandedContent?o(K,{children:o(de,{style:{width:t.reduce((a,d)=>a+d.size,0)},children:i.expandedContent})}):null]},i.id)})})]})}function Pt({columns:e}){let t=e.filter((d)=>d.kind==="data"),n=t.filter((d)=>d.canHide),i=n.filter((d)=>!d.visible),l=t.filter((d)=>d.visible),a=t.some((d)=>d.pinState);if(!n.length)return null;return I(we,{children:[o(ye,{asChild:!0,children:I(M,{variant:"outline",size:"sm",children:[o(gt,{size:16}),o(f,{children:"Columns"})]})}),I(Me,{children:[o(ze,{children:"Visible Columns"}),o(ie,{}),n.map((d)=>{let b=d.visible&&l.length<=1;return o(ke,{checked:d.visible,disabled:b,onCheckedChange:(y)=>{let H=Boolean(y);if(!H&&b)return;d.toggleVisibility?.(H)},children:I(P,{justify:"between",className:"w-full",children:[o(f,{children:d.label}),b?o(f,{className:"text-muted-foreground text-xs",children:"Required"}):null]})},d.id)}),i.length||a?I(zt,{children:[o(ie,{}),i.length?o(ne,{onPress:()=>n.forEach((d)=>d.toggleVisibility?.(!0)),children:o(f,{children:"Show All Columns"})}):null,a?o(ne,{onPress:()=>t.forEach((d)=>d.pin?.(!1)),children:o(f,{children:"Reset Pins"})}):null]}):null]})]})}function wt({column:e}){let t=G.useRef(null),n=G.useCallback(()=>{t.current=null},[]),i=G.useCallback((l)=>{let a=l.nativeEvent.pageX,d=t.current;if(t.current=a,d===null)return;let b=a-d;if(!Number.isFinite(b)||b===0)return;e.resizeBy?.(b)},[e]);return o(It.View,{testID:"resize-handle",onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderGrant:(l)=>{t.current=l.nativeEvent.pageX},onResponderMove:i,onResponderRelease:n,onResponderTerminate:n,className:"justify-center px-1",children:o(f,{className:"text-muted-foreground text-xs",children:"||"})})}function yt(e,t){if(t.kind==="selection"&&e.selectionMode==="multiple")return o(J,{"aria-label":"Select all rows",accessibilityLabel:"Select all rows",checked:e.allRowsSelected||e.someRowsSelected,onPress:(n)=>n.stopPropagation?.(),onCheckedChange:(n)=>e.toggleAllRowsSelected?.(Boolean(n))});if(t.kind==="expansion")return null;return typeof t.header==="string"?o(f,{children:t.header}):t.header}function Mt(e,t){if(!t)return null;if(t.kind==="selection")return o(J,{"aria-label":`Select row ${e.id}`,accessibilityLabel:`Select row ${e.id}`,checked:e.isSelected,onPress:(n)=>n.stopPropagation?.(),onCheckedChange:(n)=>e.toggleSelected?.(Boolean(n))});if(t.kind==="expansion"){if(!e.canExpand)return null;return o(M,{variant:"ghost",size:"icon","aria-label":e.isExpanded?`Collapse row ${e.id}`:`Expand row ${e.id}`,accessibilityLabel:e.isExpanded?`Collapse row ${e.id}`:`Expand row ${e.id}`,onPress:(n)=>{n.stopPropagation?.(),e.toggleExpanded?.()},children:e.isExpanded?o(Tt,{size:16}):o(Ct,{size:16})})}return typeof t.content==="string"?o(f,{ellipsizeMode:le(t)?"tail":void 0,numberOfLines:le(t)?1:void 0,children:t.content}):kt(t)}function le(e){return e.overflow==="truncate"||e.overflow==="expand"}function kt(e){if(e.overflow==="wrap")return o(W,{className:"min-w-0",children:e.content});if(le(e))return o(W,{className:"min-w-0 overflow-hidden",children:e.content});return e.content}export{mi as DataTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as Z}from"@contractspec/lib.ui-kit-core/utils";import*as K from"@rn-primitives/slot";import*as B from"react";import{Text as _}from"react-native";import{jsx as M}from"react/jsx-runtime";var $=B.createContext(void 0);function L({className:q,asChild:E=!1,...z}){let A=B.useContext($);return M(E?K.Text:_,{className:Z("web:select-text text-base text-foreground",A,q),...z})}import{cn as G}from"@contractspec/lib.ui-kit-core/utils";import R from"@react-native-community/datetimepicker";import{useMemo as V,useState as y}from"react";import{Platform as O,Pressable as f,View as g}from"react-native";import{jsx as H,jsxs as k}from"react/jsx-runtime";function S(q){if(!q)return"";try{return q.toLocaleDateString(void 0,{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}function u({value:q,onChange:E,disabled:z,minDate:A,maxDate:F,placeholder:Q="Select date",className:U}){let[W,I]=y(!1),X=V(()=>({minimumDate:A,maximumDate:F,timeZoneName:void 0}),[A,F]),Y=(w,J)=>{if(O.OS!=="ios")I(!1);if(J)E(J)};return k(g,{className:G("w-full",U),children:[H(f,{disabled:z,onPress:()=>I(!0),className:G("h-12 flex-row items-center rounded-md border border-input bg-background px-3",z&&"opacity-50"),children:H(L,{className:G("text-base text-foreground",!q&&"opacity-50"),children:q?S(q):Q})}),W&&H(R,{value:q??new Date,mode:"date",display:O.OS==="ios"?"inline":"default",onChange:Y,...X})]})}export{u as DatePicker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as j}from"@contractspec/lib.ui-kit-core/utils";import*as E from"@rn-primitives/slot";import*as W from"react";import{Text as h}from"react-native";import{jsx as x}from"react/jsx-runtime";var g=W.createContext(void 0);function Z({className:q,asChild:F=!1,...z}){let A=W.useContext(g);return x(F?E.Text:h,{className:j("web:select-text text-base text-foreground",A,q),...z})}import{cn as _}from"@contractspec/lib.ui-kit-core/utils";import{cva as $}from"class-variance-authority";import{View as B}from"react-native";import{jsx as R}from"react/jsx-runtime";var M="flex",m=$([M,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),o=$([M,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),v=$([M,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function s({className:q,spacing:F,align:z,justify:A,width:G,padding:J,gap:K,wrap:L,...O}){return R(B,{className:_(v({spacing:F,align:z,justify:A,width:G,padding:J,gap:K,wrap:L}),q),...O})}function P({className:q,spacing:F,align:z,justify:A,width:G,padding:J,gap:K,wrap:L,...O}){return R(B,{className:_(o({spacing:F,align:z,justify:A,width:G,padding:J,gap:K,wrap:L}),q),...O})}function T({className:q,spacing:F,align:z,justify:A,width:G,padding:J,gap:K,...L}){return R(B,{className:_(m({spacing:F,align:z,justify:A,width:G,padding:J,gap:K}),q),...L})}import{cn as U}from"@contractspec/lib.ui-kit-core/utils";import V from"@react-native-community/datetimepicker";import{useMemo as p,useState as y}from"react";import{Platform as X,Pressable as N}from"react-native";import{jsx as Q,jsxs as C}from"react/jsx-runtime";function f(q){if(!q)return"";try{return q.toLocaleDateString()}catch{return""}}function Iq({value:q,onChange:F,disabled:z,minDate:A,maxDate:G,placeholders:J,className:K}){let[L,O]=y(!1),[k,H]=y(!1),D=p(()=>({minimumDate:A,maximumDate:G}),[A,G]),b=(S,I)=>{if(X.OS!=="ios")O(!1);if(!I)return;let Y=q.end&&I>q.end?I:q.end;F({start:I,end:Y})},w=(S,I)=>{if(X.OS!=="ios")H(!1);if(!I)return;let Y=q.start&&I<q.start?I:q.start;F({start:Y,end:I})};return C(T,{className:U("w-full",K),spacing:"sm",children:[C(P,{gap:"sm",children:[Q(N,{disabled:z,onPress:()=>O(!0),className:U("h-12 flex-1 flex-row items-center rounded-md border border-input bg-background px-3",z&&"opacity-50"),children:Q(Z,{className:U("text-base text-foreground",!q.start&&"opacity-50"),children:q.start?f(q.start):J?.start||"Start date"})}),Q(N,{disabled:z,onPress:()=>H(!0),className:U("h-12 flex-1 flex-row items-center rounded-md border border-input bg-background px-3",z&&"opacity-50"),children:Q(Z,{className:U("text-base text-foreground",!q.end&&"opacity-50"),children:q.end?f(q.end):J?.end||"End date"})})]}),L&&Q(V,{value:q.start??new Date,mode:"date",display:X.OS==="ios"?"inline":"default",onChange:b,...D}),k&&Q(V,{value:q.end??q.start??new Date,mode:"date",display:X.OS==="ios"?"inline":"default",onChange:w,minimumDate:q.start??A,maximumDate:G})]})}export{Iq as DateRangePicker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as N}from"@contractspec/lib.ui-kit-core/utils";import*as T from"@rn-primitives/slot";import*as M from"react";import{Text as h}from"react-native";import{jsx as b}from"react/jsx-runtime";var y=M.createContext(void 0);function O({className:P,asChild:f=!1,...q}){let A=M.useContext(y);return b(f?T.Text:h,{className:N("web:select-text text-base text-foreground",A,P),...q})}import{cn as U}from"@contractspec/lib.ui-kit-core/utils";import{cva as W}from"class-variance-authority";import{View as X}from"react-native";import{jsx as Z}from"react/jsx-runtime";var Y="flex",g=W([Y,"flex-col"],{variants:{spacing:{none:"",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-4",lg:"gap-y-6",xl:"gap-y-8","2xl":"gap-y-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{spacing:"md",align:"stretch",justify:"start",width:"auto",padding:"none",gap:"none"}}),w=W([Y,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"start",width:"auto",padding:"none",gap:"none",wrap:"wrap"}}),m=W([Y,"flex-row"],{variants:{spacing:{none:"",xs:"gap-x-1",sm:"gap-x-2",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},align:{stretch:"items-stretch",start:"items-start",center:"items-center",end:"items-end",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},width:{auto:"w-auto",full:"w-full",screen:"w-screen",fit:"w-fit"},padding:{none:"",xs:"p-1",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"},gap:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap",reverse:"flex-wrap-reverse"}},defaultVariants:{spacing:"md",align:"center",justify:"center",width:"auto",padding:"none",gap:"none",wrap:"wrap"}});function F0({className:P,spacing:f,align:q,justify:A,width:z,padding:F,gap:G,wrap:E,...I}){return Z(X,{className:U(m({spacing:f,align:q,justify:A,width:z,padding:F,gap:G,wrap:E}),P),...I})}function k({className:P,spacing:f,align:q,justify:A,width:z,padding:F,gap:G,wrap:E,...I}){return Z(X,{className:U(w({spacing:f,align:q,justify:A,width:z,padding:F,gap:G,wrap:E}),P),...I})}function G0({className:P,spacing:f,align:q,justify:A,width:z,padding:F,gap:G,...E}){return Z(X,{className:U(g({spacing:f,align:q,justify:A,width:z,padding:F,gap:G}),P),...E})}import{cn as _}from"@contractspec/lib.ui-kit-core/utils";import o from"@react-native-community/datetimepicker";import{useMemo as j,useState as r}from"react";import{Platform as H,Pressable as x,View as n}from"react-native";import{jsx as $,jsxs as u}from"react/jsx-runtime";function v(P){if(!P)return"";try{return P.toLocaleDateString(void 0,{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}function D({value:P,onChange:f,disabled:q,minDate:A,maxDate:z,placeholder:F="Select date",className:G}){let[E,I]=r(!1),L=j(()=>({minimumDate:A,maximumDate:z,timeZoneName:void 0}),[A,z]),Q=(J,K)=>{if(H.OS!=="ios")I(!1);if(K)f(K)};return u(n,{className:_("w-full",G),children:[$(x,{disabled:q,onPress:()=>I(!0),className:_("h-12 flex-row items-center rounded-md border border-input bg-background px-3",q&&"opacity-50"),children:$(O,{className:_("text-base text-foreground",!P&&"opacity-50"),children:P?v(P):F})}),E&&$(o,{value:P??new Date,mode:"date",display:H.OS==="ios"?"inline":"default",onChange:Q,...L})]})}import{cn as B}from"@contractspec/lib.ui-kit-core/utils";import p from"@react-native-community/datetimepicker";import{useMemo as d,useState as c}from"react";import{Platform as C,Pressable as l,View as i}from"react-native";import{jsx as R,jsxs as s}from"react/jsx-runtime";function t(P,f){if(!P)return"";try{return P.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!f})}catch{return""}}function S({value:P,onChange:f,disabled:q,placeholder:A="Select time",is24Hour:z=!0,className:F}){let[G,E]=c(!1),I=d(()=>({is24Hour:z,timeZoneName:void 0}),[z]),L=(Q,J)=>{if(C.OS!=="ios")E(!1);if(J)f(J)};return s(i,{className:B("w-full",F),children:[R(l,{disabled:q,onPress:()=>E(!0),className:B("h-12 flex-row items-center rounded-md border border-input bg-background px-3",q&&"opacity-50"),children:R(O,{className:B("text-base text-foreground",!P&&"opacity-50"),children:P?t(P,z):A})}),G&&R(p,{value:P??new Date,mode:"time",display:C.OS==="ios"?"spinner":"default",onChange:L,...I})]})}import{jsx as V,jsxs as e}from"react/jsx-runtime";function D0({value:P,onChange:f,disabled:q,minDate:A,maxDate:z,datePlaceholder:F,timePlaceholder:G,is24Hour:E,className:I}){return e(k,{className:I,gap:"sm",children:[V(D,{value:P,onChange:(J)=>{if(!J)return;let K=new Date(J);if(P)K.setHours(P.getHours(),P.getMinutes(),0,0);f(K)},disabled:q,minDate:A,maxDate:z,placeholder:F,className:"flex-1"}),V(S,{value:P,onChange:(J)=>{if(!J)return;let K=new Date(P??new Date);K.setHours(J.getHours(),J.getMinutes(),0,0),f(K)},disabled:q,is24Hour:E,placeholder:G,className:"flex-1"})]})}export{D0 as DateTimePicker};
|