@medway-ui/core 1.32.0 → 1.33.1
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/COMPONENTS.md +242 -3
- package/COMPONENTS_SUMMARY.md +3 -1
- package/README.md +2 -2
- package/dist/COMPONENTS.md +242 -3
- package/dist/COMPONENTS_SUMMARY.md +3 -1
- package/dist/components/Alert.js +1 -1
- package/dist/components/Autocomplete.d.mts.map +1 -1
- package/dist/components/Autocomplete.d.ts.map +1 -1
- package/dist/components/Autocomplete.js +1 -1
- package/dist/components/Autocomplete.mjs +1 -1
- package/dist/components/Breadcrumb.d.mts +5 -2
- package/dist/components/Breadcrumb.d.mts.map +1 -1
- package/dist/components/Breadcrumb.d.ts +5 -2
- package/dist/components/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb.mjs +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/CardContinue.mjs +1 -1
- package/dist/components/CardModule.d.mts.map +1 -1
- package/dist/components/CardModule.d.ts.map +1 -1
- package/dist/components/CardModule.js +1 -1
- package/dist/components/CardModule.mjs +1 -1
- package/dist/components/CardNews.d.mts +1 -1
- package/dist/components/CardNews.d.mts.map +1 -1
- package/dist/components/CardNews.d.ts +1 -1
- package/dist/components/CardNews.d.ts.map +1 -1
- package/dist/components/CardNews.js +1 -1
- package/dist/components/CardNews.mjs +1 -1
- package/dist/components/CardTopic.d.mts.map +1 -1
- package/dist/components/CardTopic.d.ts.map +1 -1
- package/dist/components/CardTopic.js +1 -1
- package/dist/components/CardTopic.mjs +1 -1
- package/dist/components/CardWeek.js +1 -1
- package/dist/components/CardWeek.mjs +1 -1
- package/dist/components/Carousel.d.mts +76 -0
- package/dist/components/Carousel.d.mts.map +1 -0
- package/dist/components/Carousel.d.ts +76 -0
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel.js +4 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Carousel.mjs +4 -0
- package/dist/components/Carousel.mjs.map +1 -0
- package/dist/components/Chip.js +1 -1
- package/dist/components/Chip.mjs +1 -1
- package/dist/components/DatePicker.d.mts.map +1 -1
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/Input.d.mts.map +1 -1
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/NoteEditor.d.mts.map +1 -1
- package/dist/components/NoteEditor.d.ts.map +1 -1
- package/dist/components/NoteEditor.js +1 -1
- package/dist/components/NoteEditor.mjs +1 -1
- package/dist/components/Offcanvas.d.mts.map +1 -1
- package/dist/components/Offcanvas.d.ts.map +1 -1
- package/dist/components/Offcanvas.js +1 -1
- package/dist/components/Offcanvas.mjs +1 -1
- package/dist/components/Pagination.d.mts.map +1 -1
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Popover.js +1 -1
- package/dist/components/Progress.d.mts.map +1 -1
- package/dist/components/Progress.d.ts.map +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Progress.mjs +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Ranking.d.mts.map +1 -1
- package/dist/components/Ranking.d.ts.map +1 -1
- package/dist/components/Ranking.js +1 -1
- package/dist/components/Ranking.mjs +1 -1
- package/dist/components/Rating.d.mts.map +1 -1
- package/dist/components/Rating.d.ts.map +1 -1
- package/dist/components/Rating.js +1 -1
- package/dist/components/Rating.mjs +1 -1
- package/dist/components/SegmentControl.d.mts.map +1 -1
- package/dist/components/SegmentControl.d.ts.map +1 -1
- package/dist/components/SegmentControl.js +1 -1
- package/dist/components/SegmentControl.mjs +1 -1
- package/dist/components/Select.d.mts.map +1 -1
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Sidebar.d.mts.map +1 -1
- package/dist/components/Sidebar.d.ts.map +1 -1
- package/dist/components/Sidebar.js +1 -1
- package/dist/components/Sidebar.mjs +1 -1
- package/dist/components/Switcher.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Tag.js +1 -1
- package/dist/components/Toast.d.mts +6 -3
- package/dist/components/Toast.d.mts.map +1 -1
- package/dist/components/Toast.d.ts +6 -3
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/hooks/use-composed-refs.d.mts +1 -1
- package/dist/hooks/use-composed-refs.d.mts.map +1 -1
- package/dist/hooks/use-composed-refs.d.ts +1 -1
- package/dist/hooks/use-composed-refs.d.ts.map +1 -1
- package/dist/hooks/use-composed-refs.js +1 -1
- package/dist/hooks/use-composed-refs.mjs +1 -1
- package/dist/hooks/use-mobile.d.mts.map +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.mjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.d.mts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.d.mts.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.js +3 -0
- package/dist/hooks/use-prefers-reduced-motion.js.map +1 -0
- package/dist/hooks/use-prefers-reduced-motion.mjs +3 -0
- package/dist/hooks/use-prefers-reduced-motion.mjs.map +1 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/cmdk.d.mts.map +1 -1
- package/dist/lib/cmdk.d.ts.map +1 -1
- package/dist/lib/cmdk.js +1 -1
- package/dist/lib/cmdk.mjs +1 -1
- package/dist/lib/image-toolbar-placement.d.mts +32 -0
- package/dist/lib/image-toolbar-placement.d.mts.map +1 -0
- package/dist/lib/image-toolbar-placement.d.ts +32 -0
- package/dist/lib/image-toolbar-placement.d.ts.map +1 -0
- package/dist/lib/image-toolbar-placement.js +3 -0
- package/dist/lib/image-toolbar-placement.js.map +1 -0
- package/dist/lib/image-toolbar-placement.mjs +3 -0
- package/dist/lib/image-toolbar-placement.mjs.map +1 -0
- package/package.json +28 -13
package/COMPONENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @medway-ui/core — Component Reference
|
|
2
2
|
|
|
3
3
|
> **Auto-generated — do not edit manually.**
|
|
4
|
-
> Package `@medway-ui/core` · v1.
|
|
4
|
+
> Package `@medway-ui/core` · v1.33.1 · Generated 2026-10-16
|
|
5
5
|
|
|
6
6
|
All components require React 18+ and are client components (`"use client"`).
|
|
7
7
|
|
|
@@ -33,6 +33,7 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
33
33
|
- [CardContinue](#cardcontinue)
|
|
34
34
|
- [CardLesson](#cardlesson)
|
|
35
35
|
- [CardNews](#cardnews)
|
|
36
|
+
- [Carousel](#carousel)
|
|
36
37
|
- [Checkbox](#checkbox)
|
|
37
38
|
- [Chip](#chip)
|
|
38
39
|
- [Collapsible](#collapsible)
|
|
@@ -330,7 +331,7 @@ type BadgeAnimation = "shine"
|
|
|
330
331
|
|
|
331
332
|
**Sub-components:** `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`
|
|
332
333
|
|
|
333
|
-
**Exported types:** `BreadcrumbItemProps`, `BreadcrumbLinkProps`
|
|
334
|
+
**Exported types:** `BreadcrumbEllipsisProps`, `BreadcrumbItemProps`, `BreadcrumbLinkProps`
|
|
334
335
|
|
|
335
336
|
### `BreadcrumbItemProps`
|
|
336
337
|
|
|
@@ -344,6 +345,12 @@ type BadgeAnimation = "shine"
|
|
|
344
345
|
|------|------|:--------:|
|
|
345
346
|
| `asChild` | `boolean` | |
|
|
346
347
|
|
|
348
|
+
### `BreadcrumbEllipsisProps`
|
|
349
|
+
|
|
350
|
+
| Prop | Type | Required |
|
|
351
|
+
|------|------|:--------:|
|
|
352
|
+
| `label` | `string` | |
|
|
353
|
+
|
|
347
354
|
---
|
|
348
355
|
|
|
349
356
|
## Button
|
|
@@ -650,6 +657,228 @@ type CardLessonProps = | (ComponentProps<"div"> & {
|
|
|
650
657
|
|
|
651
658
|
---
|
|
652
659
|
|
|
660
|
+
## Carousel
|
|
661
|
+
|
|
662
|
+
**Sub-components:** `Carousel`, `CarouselAutoplayToggle`, `CarouselContent`, `CarouselDots`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`
|
|
663
|
+
|
|
664
|
+
**Functions / variant helpers:** `useCarousel`
|
|
665
|
+
|
|
666
|
+
**Exported types:** `CarouselAlign`, `CarouselApi`, `CarouselArrowProps`, `CarouselAutoplayOptions`, `CarouselAutoplayToggleProps`, `CarouselContentProps`, `CarouselControls`, `CarouselControlsFrom`, `CarouselDotsProps`, `CarouselEdgeBehavior`, `CarouselGap`, `CarouselOptions`, `CarouselOrientation`, `CarouselProps`, `CarouselState`, `CarouselStep`, `CarouselTransition`
|
|
667
|
+
|
|
668
|
+
### `carouselVariants` — CVA Variants
|
|
669
|
+
|
|
670
|
+
**`orientation`**:
|
|
671
|
+
|
|
672
|
+
`"horizontal"` \| `"vertical"`
|
|
673
|
+
|
|
674
|
+
**`controls`**:
|
|
675
|
+
|
|
676
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
677
|
+
|
|
678
|
+
### `carouselViewportVariants` — CVA Variants
|
|
679
|
+
|
|
680
|
+
**`orientation`**:
|
|
681
|
+
|
|
682
|
+
`"horizontal"` \| `"vertical"`
|
|
683
|
+
|
|
684
|
+
**`controls`**:
|
|
685
|
+
|
|
686
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
687
|
+
|
|
688
|
+
### `carouselArrowVariants` — CVA Variants
|
|
689
|
+
|
|
690
|
+
**`orientation`**:
|
|
691
|
+
|
|
692
|
+
`"horizontal"` \| `"vertical"`
|
|
693
|
+
|
|
694
|
+
**`controls`**:
|
|
695
|
+
|
|
696
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
697
|
+
|
|
698
|
+
**`direction`**:
|
|
699
|
+
|
|
700
|
+
`"previous"` \| `"next"`
|
|
701
|
+
|
|
702
|
+
**`controlsFrom`**:
|
|
703
|
+
|
|
704
|
+
`"always"` \| `"md"` \| `"lg"`
|
|
705
|
+
|
|
706
|
+
### `carouselArrowButtonVariants` — CVA Variants
|
|
707
|
+
|
|
708
|
+
**`orientation`**:
|
|
709
|
+
|
|
710
|
+
`"horizontal"` \| `"vertical"`
|
|
711
|
+
|
|
712
|
+
**`controls`**:
|
|
713
|
+
|
|
714
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
715
|
+
|
|
716
|
+
**`direction`**:
|
|
717
|
+
|
|
718
|
+
`"previous"` \| `"next"`
|
|
719
|
+
|
|
720
|
+
**`opaque`**:
|
|
721
|
+
|
|
722
|
+
`"true"` \| `"false"`
|
|
723
|
+
|
|
724
|
+
### `carouselEdgeFadeVariants` — CVA Variants
|
|
725
|
+
|
|
726
|
+
**`orientation`**:
|
|
727
|
+
|
|
728
|
+
`"horizontal"` \| `"vertical"`
|
|
729
|
+
|
|
730
|
+
**`edge`**:
|
|
731
|
+
|
|
732
|
+
`"start"` \| `"end"`
|
|
733
|
+
|
|
734
|
+
**`visible`**:
|
|
735
|
+
|
|
736
|
+
`"true"` \| `"false"`
|
|
737
|
+
|
|
738
|
+
### `CarouselAutoplayOptions`
|
|
739
|
+
|
|
740
|
+
| Prop | Type | Required |
|
|
741
|
+
|------|------|:--------:|
|
|
742
|
+
| `delay` | `number` | |
|
|
743
|
+
|
|
744
|
+
### `CarouselProps`
|
|
745
|
+
|
|
746
|
+
*Extends: Omit<ComponentProps<"div">, "aria-label">*
|
|
747
|
+
|
|
748
|
+
| Prop | Type | Required |
|
|
749
|
+
|------|------|:--------:|
|
|
750
|
+
| `"aria-label"` | `string` | ✓ |
|
|
751
|
+
| `orientation` | `CarouselOrientation` | |
|
|
752
|
+
| `align` | `CarouselAlign` | |
|
|
753
|
+
| `step` | `CarouselStep` | |
|
|
754
|
+
| `loop` | `boolean` | |
|
|
755
|
+
| `dragFree` | `boolean` | |
|
|
756
|
+
| `transition` | `CarouselTransition` | |
|
|
757
|
+
| `autoplay` | `boolean \| CarouselAutoplayOptions` | |
|
|
758
|
+
| `controls` | `CarouselControls` | |
|
|
759
|
+
| `controlsFrom` | `CarouselControlsFrom` | |
|
|
760
|
+
| `edgeBehavior` | `CarouselEdgeBehavior` | |
|
|
761
|
+
| `hideControlsWhenFits` | `boolean` | |
|
|
762
|
+
| `index` | `number` | |
|
|
763
|
+
| `defaultIndex` | `number` | |
|
|
764
|
+
| `onIndexChange` | `(index: number) => void` | |
|
|
765
|
+
| `setApi` | `(api: CarouselApi) => void` | |
|
|
766
|
+
| `opts` | `CarouselOptions` | |
|
|
767
|
+
|
|
768
|
+
### `CarouselContentProps`
|
|
769
|
+
|
|
770
|
+
| Prop | Type | Required |
|
|
771
|
+
|------|------|:--------:|
|
|
772
|
+
| `gap` | `CarouselGap` | |
|
|
773
|
+
| `fadeEdges` | `boolean` | |
|
|
774
|
+
| `fadeClassName` | `string` | |
|
|
775
|
+
| `viewportClassName` | `string` | |
|
|
776
|
+
|
|
777
|
+
### `CarouselDotsProps`
|
|
778
|
+
|
|
779
|
+
| Prop | Type | Required |
|
|
780
|
+
|------|------|:--------:|
|
|
781
|
+
| `getDotLabel` | `(index: number, total: number) => string` | |
|
|
782
|
+
| `dotClassName` | `string` | |
|
|
783
|
+
| `indicatorClassName` | `string` | |
|
|
784
|
+
|
|
785
|
+
### `CarouselState`
|
|
786
|
+
|
|
787
|
+
| Prop | Type | Required |
|
|
788
|
+
|------|------|:--------:|
|
|
789
|
+
| `selectedIndex` | `number` | ✓ |
|
|
790
|
+
| `snapCount` | `number` | ✓ |
|
|
791
|
+
| `canScrollPrev` | `boolean` | ✓ |
|
|
792
|
+
| `canScrollNext` | `boolean` | ✓ |
|
|
793
|
+
| `isScrollable` | `boolean` | ✓ |
|
|
794
|
+
| `scrollPrev` | `() => void` | ✓ |
|
|
795
|
+
| `scrollNext` | `() => void` | ✓ |
|
|
796
|
+
| `scrollTo` | `(index: number) => void` | ✓ |
|
|
797
|
+
| `autoplay` | `CarouselAutoplayState` | ✓ |
|
|
798
|
+
|
|
799
|
+
### `CarouselApi` *(type)*
|
|
800
|
+
|
|
801
|
+
```typescript
|
|
802
|
+
type CarouselApi = NonNullable<UseEmblaCarouselType[1]>
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
### `CarouselOptions` *(type)*
|
|
806
|
+
|
|
807
|
+
```typescript
|
|
808
|
+
type CarouselOptions = Omit<
|
|
809
|
+
NonNullable<Parameters<typeof useEmblaCarousel>[0]>,
|
|
810
|
+
"axis" | "align" | "loop" | "dragFree" | "slidesToScroll" | "startIndex"
|
|
811
|
+
>
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### `CarouselOrientation` *(type)*
|
|
815
|
+
|
|
816
|
+
```typescript
|
|
817
|
+
type CarouselOrientation = "horizontal" | "vertical"
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
### `CarouselAlign` *(type)*
|
|
821
|
+
|
|
822
|
+
```typescript
|
|
823
|
+
type CarouselAlign = "start" | "center" | "end"
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
### `CarouselStep` *(type)*
|
|
827
|
+
|
|
828
|
+
```typescript
|
|
829
|
+
type CarouselStep = number | "page"
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
### `CarouselTransition` *(type)*
|
|
833
|
+
|
|
834
|
+
```typescript
|
|
835
|
+
type CarouselTransition = "slide" | "fade"
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
### `CarouselControls` *(type)*
|
|
839
|
+
|
|
840
|
+
```typescript
|
|
841
|
+
type CarouselControls = "side" | "floating" | "outside" | "inline"
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
### `CarouselControlsFrom` *(type)*
|
|
845
|
+
|
|
846
|
+
```typescript
|
|
847
|
+
type CarouselControlsFrom = "always" | "md" | "lg"
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### `CarouselEdgeBehavior` *(type)*
|
|
851
|
+
|
|
852
|
+
```typescript
|
|
853
|
+
type CarouselEdgeBehavior = "disable" | "hide"
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
### `CarouselGap` *(type)*
|
|
857
|
+
|
|
858
|
+
```typescript
|
|
859
|
+
type CarouselGap = "none" | "xs" | "sm" | "md" | "lg" | "xl"
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
### `CarouselArrowProps` *(type)*
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
type CarouselArrowProps = Omit<
|
|
866
|
+
ButtonProps,
|
|
867
|
+
"iconLeft" | "iconRight" | "children"
|
|
868
|
+
>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
### `CarouselAutoplayToggleProps` *(type)*
|
|
872
|
+
|
|
873
|
+
```typescript
|
|
874
|
+
type CarouselAutoplayToggleProps = Omit<
|
|
875
|
+
ButtonProps,
|
|
876
|
+
"iconLeft" | "iconRight" | "children"
|
|
877
|
+
>
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
---
|
|
881
|
+
|
|
653
882
|
## Checkbox
|
|
654
883
|
|
|
655
884
|
**Sub-components:** `Checkbox`
|
|
@@ -1824,7 +2053,7 @@ type TabsSize = "md" | "lg"
|
|
|
1824
2053
|
|
|
1825
2054
|
**Functions / variant helpers:** `toastVariants`
|
|
1826
2055
|
|
|
1827
|
-
**Exported types:** `ToastActionElement`, `ToastActionProps`, `ToastActionVariant`, `ToastCloseProps`, `ToastProps`
|
|
2056
|
+
**Exported types:** `ToastActionElement`, `ToastActionProps`, `ToastActionVariant`, `ToastCloseProps`, `ToastProps`, `ToastProviderProps`
|
|
1828
2057
|
|
|
1829
2058
|
> **Radix UI base:** `Toast` — sub-components forward all Radix UI props.
|
|
1830
2059
|
|
|
@@ -1865,6 +2094,12 @@ type TabsSize = "md" | "lg"
|
|
|
1865
2094
|
| `label` | `string` | |
|
|
1866
2095
|
| `variant` | `ToastProps["variant"]` | |
|
|
1867
2096
|
|
|
2097
|
+
### `ToastProviderProps`
|
|
2098
|
+
|
|
2099
|
+
| Prop | Type | Required |
|
|
2100
|
+
|------|------|:--------:|
|
|
2101
|
+
| `children` | `ReactNode` | |
|
|
2102
|
+
|
|
1868
2103
|
### `ToastActionVariant` *(type)*
|
|
1869
2104
|
|
|
1870
2105
|
```typescript
|
|
@@ -1978,6 +2213,10 @@ Returns `boolean`. `true` when `window.innerWidth < 768px`.
|
|
|
1978
2213
|
Sidebar context hook — must be inside `<SidebarProvider>`.
|
|
1979
2214
|
Returns `{ open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }`.
|
|
1980
2215
|
|
|
2216
|
+
### `useCarousel()`
|
|
2217
|
+
|
|
2218
|
+
Exported from `Carousel`. See component docs above for context.
|
|
2219
|
+
|
|
1981
2220
|
---
|
|
1982
2221
|
|
|
1983
2222
|
## Design Tokens
|
package/COMPONENTS_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @medway-ui/core — Component Summary
|
|
2
2
|
|
|
3
|
-
> v1.
|
|
3
|
+
> v1.33.1 · For the full prop/variant reference see `COMPONENTS.md`.
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
- **CardContinue** — sub: CardContinueButton, CardContinueBreadcrumb, CardContinueContent, CardContinueHeader, CardContinueImage, CardContinueTitle
|
|
18
18
|
- **CardLesson** — variants: default, blocked | orientation: vertical, horizontal | sub: CardLessonButton, CardLessonContent, CardLessonDuration, CardLessonFooter, CardLessonHeader, CardLessonIcon, CardLessonIcons, CardLessonImage, CardLessonLabel, CardLessonStatus, CardLessonTitle
|
|
19
19
|
- **CardNews** — variants: default, read, compact | orientation: vertical, horizontal | sub: CardNewsAuthor, CardNewsBody, CardNewsContent, CardNewsDate, CardNewsDescription, CardNewsFooter, CardNewsHeader, CardNewsImage, CardNewsResourceItem, CardNewsResources, CardNewsTags, CardNewsTitle
|
|
20
|
+
- **Carousel** — orientation: horizontal, vertical | controls: side, floating, outside, inline | direction: previous, next | controlsFrom: always, md, lg | opaque: true, false | edge: start, end | visible: true, false | sub: CarouselAutoplayToggle, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious
|
|
20
21
|
- **Checkbox** — variants: regular | sizes: sm, md, lg | Radix: Checkbox
|
|
21
22
|
- **Chip** — sub: ChipChoice, ChipClear, ChipFilter
|
|
22
23
|
- **Collapsible** — Radix: Collapsible | sub: CollapsibleContent, CollapsibleTrigger
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
- `useToast()` — show/dismiss toasts
|
|
58
59
|
- `useIsMobile()` — returns boolean, breakpoint 768px
|
|
59
60
|
- `useSidebar()` — sidebar context (requires `<SidebarProvider>`)
|
|
61
|
+
- `useCarousel()` — from Carousel
|
|
60
62
|
|
|
61
63
|
## Tokens
|
|
62
64
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
- ⚡️ [NextJS](https://nextjs.org/) - Desenvolvido com NextJS
|
|
11
11
|
|
|
12
|
-
- 🔮 [
|
|
12
|
+
- 🔮 [Velite](https://velite.js.org/) - Camada de conteúdo (MDX) da documentação do design system
|
|
13
13
|
|
|
14
14
|
- 🦾 [Typescript](https://docs.expo.dev/) - Desenvolvido com o poder do Typescript
|
|
15
15
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
## Requisitos
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### Componentes
|
|
34
34
|
|
|
35
35
|
Todos os componentes que serão utilizados pela lib, deverão ser criados obrigatoriamente no seguinte diretório e na seguinte nomenclatura `(.src/components/Nome.tsx)`
|
|
36
36
|
|
package/dist/COMPONENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @medway-ui/core — Component Reference
|
|
2
2
|
|
|
3
3
|
> **Auto-generated — do not edit manually.**
|
|
4
|
-
> Package `@medway-ui/core` · v1.
|
|
4
|
+
> Package `@medway-ui/core` · v1.33.1 · Generated 2026-10-16
|
|
5
5
|
|
|
6
6
|
All components require React 18+ and are client components (`"use client"`).
|
|
7
7
|
|
|
@@ -33,6 +33,7 @@ import type { ButtonProps } from "@medway-ui/core";
|
|
|
33
33
|
- [CardContinue](#cardcontinue)
|
|
34
34
|
- [CardLesson](#cardlesson)
|
|
35
35
|
- [CardNews](#cardnews)
|
|
36
|
+
- [Carousel](#carousel)
|
|
36
37
|
- [Checkbox](#checkbox)
|
|
37
38
|
- [Chip](#chip)
|
|
38
39
|
- [Collapsible](#collapsible)
|
|
@@ -330,7 +331,7 @@ type BadgeAnimation = "shine"
|
|
|
330
331
|
|
|
331
332
|
**Sub-components:** `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`
|
|
332
333
|
|
|
333
|
-
**Exported types:** `BreadcrumbItemProps`, `BreadcrumbLinkProps`
|
|
334
|
+
**Exported types:** `BreadcrumbEllipsisProps`, `BreadcrumbItemProps`, `BreadcrumbLinkProps`
|
|
334
335
|
|
|
335
336
|
### `BreadcrumbItemProps`
|
|
336
337
|
|
|
@@ -344,6 +345,12 @@ type BadgeAnimation = "shine"
|
|
|
344
345
|
|------|------|:--------:|
|
|
345
346
|
| `asChild` | `boolean` | |
|
|
346
347
|
|
|
348
|
+
### `BreadcrumbEllipsisProps`
|
|
349
|
+
|
|
350
|
+
| Prop | Type | Required |
|
|
351
|
+
|------|------|:--------:|
|
|
352
|
+
| `label` | `string` | |
|
|
353
|
+
|
|
347
354
|
---
|
|
348
355
|
|
|
349
356
|
## Button
|
|
@@ -650,6 +657,228 @@ type CardLessonProps = | (ComponentProps<"div"> & {
|
|
|
650
657
|
|
|
651
658
|
---
|
|
652
659
|
|
|
660
|
+
## Carousel
|
|
661
|
+
|
|
662
|
+
**Sub-components:** `Carousel`, `CarouselAutoplayToggle`, `CarouselContent`, `CarouselDots`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`
|
|
663
|
+
|
|
664
|
+
**Functions / variant helpers:** `useCarousel`
|
|
665
|
+
|
|
666
|
+
**Exported types:** `CarouselAlign`, `CarouselApi`, `CarouselArrowProps`, `CarouselAutoplayOptions`, `CarouselAutoplayToggleProps`, `CarouselContentProps`, `CarouselControls`, `CarouselControlsFrom`, `CarouselDotsProps`, `CarouselEdgeBehavior`, `CarouselGap`, `CarouselOptions`, `CarouselOrientation`, `CarouselProps`, `CarouselState`, `CarouselStep`, `CarouselTransition`
|
|
667
|
+
|
|
668
|
+
### `carouselVariants` — CVA Variants
|
|
669
|
+
|
|
670
|
+
**`orientation`**:
|
|
671
|
+
|
|
672
|
+
`"horizontal"` \| `"vertical"`
|
|
673
|
+
|
|
674
|
+
**`controls`**:
|
|
675
|
+
|
|
676
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
677
|
+
|
|
678
|
+
### `carouselViewportVariants` — CVA Variants
|
|
679
|
+
|
|
680
|
+
**`orientation`**:
|
|
681
|
+
|
|
682
|
+
`"horizontal"` \| `"vertical"`
|
|
683
|
+
|
|
684
|
+
**`controls`**:
|
|
685
|
+
|
|
686
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
687
|
+
|
|
688
|
+
### `carouselArrowVariants` — CVA Variants
|
|
689
|
+
|
|
690
|
+
**`orientation`**:
|
|
691
|
+
|
|
692
|
+
`"horizontal"` \| `"vertical"`
|
|
693
|
+
|
|
694
|
+
**`controls`**:
|
|
695
|
+
|
|
696
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
697
|
+
|
|
698
|
+
**`direction`**:
|
|
699
|
+
|
|
700
|
+
`"previous"` \| `"next"`
|
|
701
|
+
|
|
702
|
+
**`controlsFrom`**:
|
|
703
|
+
|
|
704
|
+
`"always"` \| `"md"` \| `"lg"`
|
|
705
|
+
|
|
706
|
+
### `carouselArrowButtonVariants` — CVA Variants
|
|
707
|
+
|
|
708
|
+
**`orientation`**:
|
|
709
|
+
|
|
710
|
+
`"horizontal"` \| `"vertical"`
|
|
711
|
+
|
|
712
|
+
**`controls`**:
|
|
713
|
+
|
|
714
|
+
`"side"` \| `"floating"` \| `"outside"` \| `"inline"`
|
|
715
|
+
|
|
716
|
+
**`direction`**:
|
|
717
|
+
|
|
718
|
+
`"previous"` \| `"next"`
|
|
719
|
+
|
|
720
|
+
**`opaque`**:
|
|
721
|
+
|
|
722
|
+
`"true"` \| `"false"`
|
|
723
|
+
|
|
724
|
+
### `carouselEdgeFadeVariants` — CVA Variants
|
|
725
|
+
|
|
726
|
+
**`orientation`**:
|
|
727
|
+
|
|
728
|
+
`"horizontal"` \| `"vertical"`
|
|
729
|
+
|
|
730
|
+
**`edge`**:
|
|
731
|
+
|
|
732
|
+
`"start"` \| `"end"`
|
|
733
|
+
|
|
734
|
+
**`visible`**:
|
|
735
|
+
|
|
736
|
+
`"true"` \| `"false"`
|
|
737
|
+
|
|
738
|
+
### `CarouselAutoplayOptions`
|
|
739
|
+
|
|
740
|
+
| Prop | Type | Required |
|
|
741
|
+
|------|------|:--------:|
|
|
742
|
+
| `delay` | `number` | |
|
|
743
|
+
|
|
744
|
+
### `CarouselProps`
|
|
745
|
+
|
|
746
|
+
*Extends: Omit<ComponentProps<"div">, "aria-label">*
|
|
747
|
+
|
|
748
|
+
| Prop | Type | Required |
|
|
749
|
+
|------|------|:--------:|
|
|
750
|
+
| `"aria-label"` | `string` | ✓ |
|
|
751
|
+
| `orientation` | `CarouselOrientation` | |
|
|
752
|
+
| `align` | `CarouselAlign` | |
|
|
753
|
+
| `step` | `CarouselStep` | |
|
|
754
|
+
| `loop` | `boolean` | |
|
|
755
|
+
| `dragFree` | `boolean` | |
|
|
756
|
+
| `transition` | `CarouselTransition` | |
|
|
757
|
+
| `autoplay` | `boolean \| CarouselAutoplayOptions` | |
|
|
758
|
+
| `controls` | `CarouselControls` | |
|
|
759
|
+
| `controlsFrom` | `CarouselControlsFrom` | |
|
|
760
|
+
| `edgeBehavior` | `CarouselEdgeBehavior` | |
|
|
761
|
+
| `hideControlsWhenFits` | `boolean` | |
|
|
762
|
+
| `index` | `number` | |
|
|
763
|
+
| `defaultIndex` | `number` | |
|
|
764
|
+
| `onIndexChange` | `(index: number) => void` | |
|
|
765
|
+
| `setApi` | `(api: CarouselApi) => void` | |
|
|
766
|
+
| `opts` | `CarouselOptions` | |
|
|
767
|
+
|
|
768
|
+
### `CarouselContentProps`
|
|
769
|
+
|
|
770
|
+
| Prop | Type | Required |
|
|
771
|
+
|------|------|:--------:|
|
|
772
|
+
| `gap` | `CarouselGap` | |
|
|
773
|
+
| `fadeEdges` | `boolean` | |
|
|
774
|
+
| `fadeClassName` | `string` | |
|
|
775
|
+
| `viewportClassName` | `string` | |
|
|
776
|
+
|
|
777
|
+
### `CarouselDotsProps`
|
|
778
|
+
|
|
779
|
+
| Prop | Type | Required |
|
|
780
|
+
|------|------|:--------:|
|
|
781
|
+
| `getDotLabel` | `(index: number, total: number) => string` | |
|
|
782
|
+
| `dotClassName` | `string` | |
|
|
783
|
+
| `indicatorClassName` | `string` | |
|
|
784
|
+
|
|
785
|
+
### `CarouselState`
|
|
786
|
+
|
|
787
|
+
| Prop | Type | Required |
|
|
788
|
+
|------|------|:--------:|
|
|
789
|
+
| `selectedIndex` | `number` | ✓ |
|
|
790
|
+
| `snapCount` | `number` | ✓ |
|
|
791
|
+
| `canScrollPrev` | `boolean` | ✓ |
|
|
792
|
+
| `canScrollNext` | `boolean` | ✓ |
|
|
793
|
+
| `isScrollable` | `boolean` | ✓ |
|
|
794
|
+
| `scrollPrev` | `() => void` | ✓ |
|
|
795
|
+
| `scrollNext` | `() => void` | ✓ |
|
|
796
|
+
| `scrollTo` | `(index: number) => void` | ✓ |
|
|
797
|
+
| `autoplay` | `CarouselAutoplayState` | ✓ |
|
|
798
|
+
|
|
799
|
+
### `CarouselApi` *(type)*
|
|
800
|
+
|
|
801
|
+
```typescript
|
|
802
|
+
type CarouselApi = NonNullable<UseEmblaCarouselType[1]>
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
### `CarouselOptions` *(type)*
|
|
806
|
+
|
|
807
|
+
```typescript
|
|
808
|
+
type CarouselOptions = Omit<
|
|
809
|
+
NonNullable<Parameters<typeof useEmblaCarousel>[0]>,
|
|
810
|
+
"axis" | "align" | "loop" | "dragFree" | "slidesToScroll" | "startIndex"
|
|
811
|
+
>
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### `CarouselOrientation` *(type)*
|
|
815
|
+
|
|
816
|
+
```typescript
|
|
817
|
+
type CarouselOrientation = "horizontal" | "vertical"
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
### `CarouselAlign` *(type)*
|
|
821
|
+
|
|
822
|
+
```typescript
|
|
823
|
+
type CarouselAlign = "start" | "center" | "end"
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
### `CarouselStep` *(type)*
|
|
827
|
+
|
|
828
|
+
```typescript
|
|
829
|
+
type CarouselStep = number | "page"
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
### `CarouselTransition` *(type)*
|
|
833
|
+
|
|
834
|
+
```typescript
|
|
835
|
+
type CarouselTransition = "slide" | "fade"
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
### `CarouselControls` *(type)*
|
|
839
|
+
|
|
840
|
+
```typescript
|
|
841
|
+
type CarouselControls = "side" | "floating" | "outside" | "inline"
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
### `CarouselControlsFrom` *(type)*
|
|
845
|
+
|
|
846
|
+
```typescript
|
|
847
|
+
type CarouselControlsFrom = "always" | "md" | "lg"
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### `CarouselEdgeBehavior` *(type)*
|
|
851
|
+
|
|
852
|
+
```typescript
|
|
853
|
+
type CarouselEdgeBehavior = "disable" | "hide"
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
### `CarouselGap` *(type)*
|
|
857
|
+
|
|
858
|
+
```typescript
|
|
859
|
+
type CarouselGap = "none" | "xs" | "sm" | "md" | "lg" | "xl"
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
### `CarouselArrowProps` *(type)*
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
type CarouselArrowProps = Omit<
|
|
866
|
+
ButtonProps,
|
|
867
|
+
"iconLeft" | "iconRight" | "children"
|
|
868
|
+
>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
### `CarouselAutoplayToggleProps` *(type)*
|
|
872
|
+
|
|
873
|
+
```typescript
|
|
874
|
+
type CarouselAutoplayToggleProps = Omit<
|
|
875
|
+
ButtonProps,
|
|
876
|
+
"iconLeft" | "iconRight" | "children"
|
|
877
|
+
>
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
---
|
|
881
|
+
|
|
653
882
|
## Checkbox
|
|
654
883
|
|
|
655
884
|
**Sub-components:** `Checkbox`
|
|
@@ -1824,7 +2053,7 @@ type TabsSize = "md" | "lg"
|
|
|
1824
2053
|
|
|
1825
2054
|
**Functions / variant helpers:** `toastVariants`
|
|
1826
2055
|
|
|
1827
|
-
**Exported types:** `ToastActionElement`, `ToastActionProps`, `ToastActionVariant`, `ToastCloseProps`, `ToastProps`
|
|
2056
|
+
**Exported types:** `ToastActionElement`, `ToastActionProps`, `ToastActionVariant`, `ToastCloseProps`, `ToastProps`, `ToastProviderProps`
|
|
1828
2057
|
|
|
1829
2058
|
> **Radix UI base:** `Toast` — sub-components forward all Radix UI props.
|
|
1830
2059
|
|
|
@@ -1865,6 +2094,12 @@ type TabsSize = "md" | "lg"
|
|
|
1865
2094
|
| `label` | `string` | |
|
|
1866
2095
|
| `variant` | `ToastProps["variant"]` | |
|
|
1867
2096
|
|
|
2097
|
+
### `ToastProviderProps`
|
|
2098
|
+
|
|
2099
|
+
| Prop | Type | Required |
|
|
2100
|
+
|------|------|:--------:|
|
|
2101
|
+
| `children` | `ReactNode` | |
|
|
2102
|
+
|
|
1868
2103
|
### `ToastActionVariant` *(type)*
|
|
1869
2104
|
|
|
1870
2105
|
```typescript
|
|
@@ -1978,6 +2213,10 @@ Returns `boolean`. `true` when `window.innerWidth < 768px`.
|
|
|
1978
2213
|
Sidebar context hook — must be inside `<SidebarProvider>`.
|
|
1979
2214
|
Returns `{ open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }`.
|
|
1980
2215
|
|
|
2216
|
+
### `useCarousel()`
|
|
2217
|
+
|
|
2218
|
+
Exported from `Carousel`. See component docs above for context.
|
|
2219
|
+
|
|
1981
2220
|
---
|
|
1982
2221
|
|
|
1983
2222
|
## Design Tokens
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @medway-ui/core — Component Summary
|
|
2
2
|
|
|
3
|
-
> v1.
|
|
3
|
+
> v1.33.1 · For the full prop/variant reference see `COMPONENTS.md`.
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
- **CardContinue** — sub: CardContinueButton, CardContinueBreadcrumb, CardContinueContent, CardContinueHeader, CardContinueImage, CardContinueTitle
|
|
18
18
|
- **CardLesson** — variants: default, blocked | orientation: vertical, horizontal | sub: CardLessonButton, CardLessonContent, CardLessonDuration, CardLessonFooter, CardLessonHeader, CardLessonIcon, CardLessonIcons, CardLessonImage, CardLessonLabel, CardLessonStatus, CardLessonTitle
|
|
19
19
|
- **CardNews** — variants: default, read, compact | orientation: vertical, horizontal | sub: CardNewsAuthor, CardNewsBody, CardNewsContent, CardNewsDate, CardNewsDescription, CardNewsFooter, CardNewsHeader, CardNewsImage, CardNewsResourceItem, CardNewsResources, CardNewsTags, CardNewsTitle
|
|
20
|
+
- **Carousel** — orientation: horizontal, vertical | controls: side, floating, outside, inline | direction: previous, next | controlsFrom: always, md, lg | opaque: true, false | edge: start, end | visible: true, false | sub: CarouselAutoplayToggle, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious
|
|
20
21
|
- **Checkbox** — variants: regular | sizes: sm, md, lg | Radix: Checkbox
|
|
21
22
|
- **Chip** — sub: ChipChoice, ChipClear, ChipFilter
|
|
22
23
|
- **Collapsible** — Radix: Collapsible | sub: CollapsibleContent, CollapsibleTrigger
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
- `useToast()` — show/dismiss toasts
|
|
58
59
|
- `useIsMobile()` — returns boolean, breakpoint 768px
|
|
59
60
|
- `useSidebar()` — sidebar context (requires `<SidebarProvider>`)
|
|
61
|
+
- `useCarousel()` — from Carousel
|
|
60
62
|
|
|
61
63
|
## Tokens
|
|
62
64
|
|
package/dist/components/Alert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var n=require("react/jsx-runtime"),c=require("react"),b=require("class-variance-authority"),q=require("@medway-ui/icons"),P=require("./Button.js"),s=require("../lib/utils.js"),B=Object.defineProperty,z=Object.defineProperties,D=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,_=(a,r,e)=>r in a?B(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,l=(a,r)=>{for(var e in r||(r={}))y.call(r,e)&&_(a,e,r[e]);if(v)for(var e of v(r))N.call(r,e)&&_(a,e,r[e]);return a},h=(a,r)=>z(a,D(r)),i=(a,r)=>{var e={};for(var t in a)y.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&v)for(var t of v(a))r.indexOf(t)<0&&N.call(a,t)&&(e[t]=a[t]);return e};const w=c.createContext(null),k=b.cva("relative flex flex-col items-center justify-between gap-5 w-full rounded-md px-4 py-3 text-sm has-[>svg]:gap-x-9 gap-y-1 [&>svg]:translate-y-0 [&>svg]:text-current lg:flex-row",{variants:{variant:{regular:"[background:linear-gradient(0deg,_var(--color-primary-background-soft)_0%,_var(--color-primary-background-soft)_100%),_var(--color-surface-card)] text-primary-foreground [&>svg]:text-primary-foreground",emphasis:"[background:linear-gradient(0deg,_var(--color-secondary-background-soft)_0%,_var(--color-secondary-background-soft)_100%),_var(--color-surface-card)] text-secondary-foreground [&>svg]:text-secondary-foreground",success:"[background:linear-gradient(0deg,_var(--color-green-background-soft)_0%,_var(--color-green-background-soft)_100%),_var(--color-surface-card)] text-green-foreground [&>svg]:text-green-foreground",warning:"[background:linear-gradient(0deg,_var(--color-yellow-background-soft)_0%,_var(--color-yellow-background-soft)_100%),_var(--color-surface-card)] text-yellow-foreground [&>svg]:text-yellow-foreground",error:"[background:linear-gradient(0deg,_var(--color-red-background-soft)_0%,_var(--color-red-background-soft)_100%),_var(--color-surface-card)] text-red-foreground [&>svg]:text-red-foreground"}},defaultVariants:{variant:"regular"}});function E(a){var r=a,{className:e,variant:t="regular",onClose:o,closeLabel:f="Fechar alerta",role:d="alert",children:g}=r,A=i(r,["className","variant","onClose","closeLabel","role","children"]);const m=c.Children.toArray(g),x=m.some(u=>c.isValidElement(u)&&u.type===V),p=m.some(u=>c.isValidElement(u)&&u.type===j),O=c.useMemo(()=>({variant:t,hasDescription:x,hasTitle:p,onClose:o}),[t,x,p,o]);return n.jsx(w.Provider,{value:O,children:n.jsxs("div",h(l({"data-slot":"alert",role:d,className:s.cn(k({variant:t}),o&&"gap-x-9 pe-12",e)},A),{children:[g,o&&n.jsx(P.Button,{type:"button",variant:"regular-basic",size:"sm","aria-label":f,onClick:o,containerClassName:"absolute right-2 top-2",iconLeft:n.jsx(q.CloseMd,{"aria-hidden":"true",className:"!size-4 !text-gray-foreground"})})]}))})}function I(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-container",className:s.cn("flex min-w-0 gap-3",e)},t))}function L(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-content",className:s.cn("flex min-w-0 flex-col gap-1",e)},t))}function T(a){var r=a,{className:e,icon:t}=r,o=i(r,["className","icon"]);return n.jsx("div",h(l({"data-slot":"alert-icon",className:s.cn("size-6 max-[500px]:hidden",e)},o),{children:t}))}function j(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-title",className:s.cn("line-clamp-1 min-h-4 text-md font-medium",e)},t))}function V(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-description",className:s.cn("!line-clamp-3 grid justify-items-start gap-1 text-sm leading-5",e)},t))}function M(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-actions",className:s.cn("relative mt-2 flex flex-wrap items-center gap-x-2 max-[500px]:w-full max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:gap-y-2 lg:mt-0 lg:flex-nowrap",e)},t))}const C=b.cva("inline-flex items-center justify-center rounded-pill px-3 py-2 min-h-10 text-sm font-semibold transition-colors max-w-full text-center max-[500px]:w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:brightness-90",{variants:{variant:{regular:"text-current",basic:"text-current"},alertVariant:{regular:"",emphasis:"",success:"",warning:"",error:""}},compoundVariants:[{variant:"regular",alertVariant:"regular",class:"bg-primary-background-soft"},{variant:"regular",alertVariant:"emphasis",class:"bg-secondary-background-soft"},{variant:"regular",alertVariant:"success",class:"bg-green-background-soft"},{variant:"regular",alertVariant:"warning",class:"bg-yellow-background-soft"},{variant:"regular",alertVariant:"error",class:"bg-red-background-soft"}],defaultVariants:{variant:"regular",alertVariant:"regular"}});function
|
|
3
|
+
"use strict";var n=require("react/jsx-runtime"),c=require("react"),b=require("class-variance-authority"),q=require("@medway-ui/icons"),P=require("./Button.js"),s=require("../lib/utils.js"),B=Object.defineProperty,z=Object.defineProperties,D=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,_=(a,r,e)=>r in a?B(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,l=(a,r)=>{for(var e in r||(r={}))y.call(r,e)&&_(a,e,r[e]);if(v)for(var e of v(r))N.call(r,e)&&_(a,e,r[e]);return a},h=(a,r)=>z(a,D(r)),i=(a,r)=>{var e={};for(var t in a)y.call(a,t)&&r.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&v)for(var t of v(a))r.indexOf(t)<0&&N.call(a,t)&&(e[t]=a[t]);return e};const w=c.createContext(null),k=b.cva("relative flex flex-col items-center justify-between gap-5 w-full rounded-md px-4 py-3 text-sm has-[>svg]:gap-x-9 gap-y-1 [&>svg]:translate-y-0 [&>svg]:text-current lg:flex-row",{variants:{variant:{regular:"[background:linear-gradient(0deg,_var(--color-primary-background-soft)_0%,_var(--color-primary-background-soft)_100%),_var(--color-surface-card)] text-primary-foreground [&>svg]:text-primary-foreground",emphasis:"[background:linear-gradient(0deg,_var(--color-secondary-background-soft)_0%,_var(--color-secondary-background-soft)_100%),_var(--color-surface-card)] text-secondary-foreground [&>svg]:text-secondary-foreground",success:"[background:linear-gradient(0deg,_var(--color-green-background-soft)_0%,_var(--color-green-background-soft)_100%),_var(--color-surface-card)] text-green-foreground [&>svg]:text-green-foreground",warning:"[background:linear-gradient(0deg,_var(--color-yellow-background-soft)_0%,_var(--color-yellow-background-soft)_100%),_var(--color-surface-card)] text-yellow-foreground [&>svg]:text-yellow-foreground",error:"[background:linear-gradient(0deg,_var(--color-red-background-soft)_0%,_var(--color-red-background-soft)_100%),_var(--color-surface-card)] text-red-foreground [&>svg]:text-red-foreground"}},defaultVariants:{variant:"regular"}});function E(a){var r=a,{className:e,variant:t="regular",onClose:o,closeLabel:f="Fechar alerta",role:d="alert",children:g}=r,A=i(r,["className","variant","onClose","closeLabel","role","children"]);const m=c.Children.toArray(g),x=m.some(u=>c.isValidElement(u)&&u.type===V),p=m.some(u=>c.isValidElement(u)&&u.type===j),O=c.useMemo(()=>({variant:t,hasDescription:x,hasTitle:p,onClose:o}),[t,x,p,o]);return n.jsx(w.Provider,{value:O,children:n.jsxs("div",h(l({"data-slot":"alert",role:d,className:s.cn(k({variant:t}),o&&"gap-x-9 pe-12",e)},A),{children:[g,o&&n.jsx(P.Button,{type:"button",variant:"regular-basic",size:"sm","aria-label":f,onClick:o,containerClassName:"absolute right-2 top-2",iconLeft:n.jsx(q.CloseMd,{"aria-hidden":"true",className:"!size-4 !text-gray-foreground"})})]}))})}function I(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-container",className:s.cn("flex min-w-0 gap-3",e)},t))}function L(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-content",className:s.cn("flex min-w-0 flex-col gap-1",e)},t))}function T(a){var r=a,{className:e,icon:t}=r,o=i(r,["className","icon"]);return n.jsx("div",h(l({"data-slot":"alert-icon",className:s.cn("size-6 max-[500px]:hidden",e)},o),{children:t}))}function j(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-title",className:s.cn("line-clamp-1 min-h-4 text-md font-medium",e)},t))}function V(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-description",className:s.cn("!line-clamp-3 grid justify-items-start gap-1 text-sm leading-5",e)},t))}function M(a){var r=a,{className:e}=r,t=i(r,["className"]);return n.jsx("div",l({"data-slot":"alert-actions",className:s.cn("relative mt-2 flex flex-wrap items-center gap-x-2 max-[500px]:w-full max-[500px]:flex-col max-[500px]:flex-nowrap max-[500px]:items-stretch max-[500px]:gap-y-2 lg:mt-0 lg:flex-nowrap",e)},t))}const C=b.cva("inline-flex items-center justify-center rounded-pill px-3 py-2 min-h-10 text-sm font-semibold transition-colors max-w-full text-center max-[500px]:w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:brightness-90",{variants:{variant:{regular:"text-current",basic:"text-current"},alertVariant:{regular:"",emphasis:"",success:"",warning:"",error:""}},compoundVariants:[{variant:"regular",alertVariant:"regular",class:"bg-primary-background-soft"},{variant:"regular",alertVariant:"emphasis",class:"bg-secondary-background-soft"},{variant:"regular",alertVariant:"success",class:"bg-green-background-soft"},{variant:"regular",alertVariant:"warning",class:"bg-yellow-background-soft"},{variant:"regular",alertVariant:"error",class:"bg-red-background-soft"}],defaultVariants:{variant:"regular",alertVariant:"regular"}});function $(a){var r=a,{className:e,variant:t,type:o="button"}=r,f=i(r,["className","variant","type"]);const d=c.useContext(w),g=(d==null?void 0:d.variant)||"regular";return n.jsx("button",l({type:o,className:s.cn(C({variant:t,alertVariant:g}),e)},f))}exports.Alert=E,exports.AlertActions=M,exports.AlertButton=$,exports.AlertContainer=I,exports.AlertContent=L,exports.AlertDescription=V,exports.AlertIcon=T,exports.AlertTitle=j,exports.alertButtonVariants=C,exports.alertVariants=k;
|
|
4
4
|
//# sourceMappingURL=Alert.js.map
|