@kadoui/tailwindcss 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -114
- package/package.json +1 -1
- package/src/styles/alert.css +0 -2
- package/src/styles/badge.css +0 -2
- package/src/styles/base.css +50 -39
- package/src/styles/button.css +0 -2
- package/src/styles/card.css +0 -2
- package/src/styles/components/modal.css +16 -4
- package/src/styles/components/select-box.css +1 -1
- package/src/styles/input.css +0 -2
- package/src/styles/kbd.css +0 -2
package/README.md
CHANGED
|
@@ -65,12 +65,12 @@ Set up your color system and design tokens:
|
|
|
65
65
|
--background: #efefef;
|
|
66
66
|
--background-thin: #ffffff;
|
|
67
67
|
--background-thick: #dfdfdf;
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
/* Foreground colors */
|
|
70
70
|
--foreground: #151515;
|
|
71
71
|
--foreground-thin: #303030;
|
|
72
72
|
--foreground-thick: #000000;
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
/* Semantic colors */
|
|
75
75
|
--primary: #ff5e00;
|
|
76
76
|
--primary-foreground: #ffffff;
|
|
@@ -84,24 +84,24 @@ Set up your color system and design tokens:
|
|
|
84
84
|
--warning-foreground: #ffffff;
|
|
85
85
|
--info: #0000dd;
|
|
86
86
|
--info-foreground: #ffffff;
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
/* Palette system */
|
|
89
89
|
--palette: var(--foreground);
|
|
90
90
|
--brush: var(--background);
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
/* Element sizing variables */
|
|
93
93
|
--element-xs-h: calc(var(--spacing) * 6);
|
|
94
94
|
--element-sm-h: calc(var(--spacing) * 8);
|
|
95
95
|
--element-medium-h: calc(var(--spacing) * 10);
|
|
96
96
|
--element-lg-h: calc(var(--spacing) * 12);
|
|
97
97
|
--element-xl-h: calc(var(--spacing) * 14);
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
--element-xs-spacing: calc(var(--spacing) * 1);
|
|
100
100
|
--element-sm-spacing: calc(var(--spacing) * 1.5);
|
|
101
101
|
--element-medium-spacing: calc(var(--spacing) * 3);
|
|
102
102
|
--element-lg-spacing: calc(var(--spacing) * 6);
|
|
103
103
|
--element-xl-spacing: calc(var(--spacing) * 9);
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
/* Default element size */
|
|
106
106
|
--element-h: var(--element-medium-h);
|
|
107
107
|
--element-spacing: var(--element-medium-spacing);
|
|
@@ -129,7 +129,7 @@ Set up your color system and design tokens:
|
|
|
129
129
|
--color-warning-foreground: var(--warning-foreground);
|
|
130
130
|
--color-info: var(--info);
|
|
131
131
|
--color-info-foreground: var(--info-foreground);
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
--color-palette: var(--palette);
|
|
134
134
|
--color-brush: var(--brush);
|
|
135
135
|
}
|
|
@@ -177,28 +177,29 @@ export default {
|
|
|
177
177
|
|
|
178
178
|
The design system uses a consistent spacing scale based on Tailwind's default spacing:
|
|
179
179
|
|
|
180
|
-
| Level | Value
|
|
181
|
-
|
|
180
|
+
| Level | Value | Usage |
|
|
181
|
+
| ----- | ----------- | -------------------- |
|
|
182
182
|
| lvl-1 | `0.5` (2px) | Tight spacing, icons |
|
|
183
|
-
| lvl-2 | `1.5` (6px) | Small gaps
|
|
184
|
-
| lvl-3 | `3` (12px)
|
|
185
|
-
| lvl-4 | `6` (24px)
|
|
186
|
-
| lvl-5 | `9` (36px)
|
|
187
|
-
| lvl-6 | `12` (48px) | Section spacing
|
|
188
|
-
| lvl-7 | `16` (64px) | Page sections
|
|
189
|
-
| lvl-8 | `20` (80px) | Major sections
|
|
183
|
+
| lvl-2 | `1.5` (6px) | Small gaps |
|
|
184
|
+
| lvl-3 | `3` (12px) | Default spacing |
|
|
185
|
+
| lvl-4 | `6` (24px) | Large gaps |
|
|
186
|
+
| lvl-5 | `9` (36px) | Extra large gaps |
|
|
187
|
+
| lvl-6 | `12` (48px) | Section spacing |
|
|
188
|
+
| lvl-7 | `16` (64px) | Page sections |
|
|
189
|
+
| lvl-8 | `20` (80px) | Major sections |
|
|
190
190
|
|
|
191
191
|
### Breakpoints
|
|
192
192
|
|
|
193
|
-
| Breakpoint | Min Width | Description
|
|
194
|
-
|
|
195
|
-
| `sm`
|
|
196
|
-
| `md`
|
|
197
|
-
| `lg`
|
|
198
|
-
| `xl`
|
|
199
|
-
| `2xl`
|
|
193
|
+
| Breakpoint | Min Width | Description |
|
|
194
|
+
| ---------- | --------- | ------------------- |
|
|
195
|
+
| `sm` | 640px | Mobile |
|
|
196
|
+
| `md` | 768px | Tablet |
|
|
197
|
+
| `lg` | 1024px | Desktop |
|
|
198
|
+
| `xl` | 1280px | Large desktop |
|
|
199
|
+
| `2xl` | 1536px | Extra large desktop |
|
|
200
200
|
|
|
201
201
|
**Recommended Usage:**
|
|
202
|
+
|
|
202
203
|
- `sm` - Mobile-first (default)
|
|
203
204
|
- `sm:` - Tablet and up
|
|
204
205
|
- `lg:` - Desktop and up
|
|
@@ -277,6 +278,7 @@ The element sizing system provides consistent sizing across components:
|
|
|
277
278
|
- `element-xl` - Extra large (14 × spacing)
|
|
278
279
|
|
|
279
280
|
Each size variant sets:
|
|
281
|
+
|
|
280
282
|
- `--element-h` - Height
|
|
281
283
|
- `--element-spacing` - Padding/spacing
|
|
282
284
|
- `--element-text` - Font size
|
|
@@ -299,7 +301,7 @@ Each size variant sets:
|
|
|
299
301
|
#### Element Utilities
|
|
300
302
|
|
|
301
303
|
- `element-square-size` - Makes element square (width = height)
|
|
302
|
-
- `element-full
|
|
304
|
+
- `element-w-full` - Full width element
|
|
303
305
|
- `element-icon-size` - Icon size (half of element height)
|
|
304
306
|
|
|
305
307
|
**Example:**
|
|
@@ -311,7 +313,7 @@ Each size variant sets:
|
|
|
311
313
|
</button>
|
|
312
314
|
|
|
313
315
|
<!-- Full width button -->
|
|
314
|
-
<button class="btn btn-fill element-full
|
|
316
|
+
<button class="btn btn-fill element-w-full">Full Width</button>
|
|
315
317
|
|
|
316
318
|
<!-- Icon -->
|
|
317
319
|
<Icon class="element-icon-size" />
|
|
@@ -319,13 +321,13 @@ Each size variant sets:
|
|
|
319
321
|
|
|
320
322
|
### Border Radius
|
|
321
323
|
|
|
322
|
-
| Level | Class
|
|
323
|
-
|
|
324
|
-
| lvl-1 | `rounded`
|
|
325
|
-
| lvl-2 | `rounded-md`
|
|
326
|
-
| lvl-3 | `rounded-lg`
|
|
327
|
-
| lvl-4 | `rounded-xl`
|
|
328
|
-
| lvl-5 | `rounded-2xl` | 2XL radius
|
|
324
|
+
| Level | Class | Value |
|
|
325
|
+
| ----- | ------------- | ------------------ |
|
|
326
|
+
| lvl-1 | `rounded` | Small radius |
|
|
327
|
+
| lvl-2 | `rounded-md` | Medium radius |
|
|
328
|
+
| lvl-3 | `rounded-lg` | Large radius |
|
|
329
|
+
| lvl-4 | `rounded-xl` | Extra large radius |
|
|
330
|
+
| lvl-5 | `rounded-2xl` | 2XL radius |
|
|
329
331
|
|
|
330
332
|
---
|
|
331
333
|
|
|
@@ -340,6 +342,7 @@ Each size variant sets:
|
|
|
340
342
|
```
|
|
341
343
|
|
|
342
344
|
**Recommended Pattern:**
|
|
345
|
+
|
|
343
346
|
```html
|
|
344
347
|
<h1 class="text-xl sm:text-2xl lg:text-5xl font-black">Responsive Heading</h1>
|
|
345
348
|
```
|
|
@@ -351,6 +354,7 @@ Each size variant sets:
|
|
|
351
354
|
```
|
|
352
355
|
|
|
353
356
|
**Recommended Pattern:**
|
|
357
|
+
|
|
354
358
|
```html
|
|
355
359
|
<h2 class="text-base sm:text-lg lg:text-xl font-bold">Responsive Title</h2>
|
|
356
360
|
```
|
|
@@ -358,6 +362,7 @@ Each size variant sets:
|
|
|
358
362
|
#### Paragraphs
|
|
359
363
|
|
|
360
364
|
**Recommended Pattern:**
|
|
365
|
+
|
|
361
366
|
```html
|
|
362
367
|
<p class="text-sm sm:text-base">Responsive paragraph text</p>
|
|
363
368
|
```
|
|
@@ -383,7 +388,11 @@ Centered container with max-width:
|
|
|
383
388
|
Styled link with hover underline:
|
|
384
389
|
|
|
385
390
|
```html
|
|
386
|
-
<a
|
|
391
|
+
<a
|
|
392
|
+
href="#"
|
|
393
|
+
class="link"
|
|
394
|
+
>Link text</a
|
|
395
|
+
>
|
|
387
396
|
```
|
|
388
397
|
|
|
389
398
|
#### Highlight
|
|
@@ -457,6 +466,7 @@ Buttons are the foundation of interactive elements.
|
|
|
457
466
|
#### Button States
|
|
458
467
|
|
|
459
468
|
Buttons automatically handle:
|
|
469
|
+
|
|
460
470
|
- `disabled` - Reduced opacity, no pointer events
|
|
461
471
|
- `focus-visible` - Outline ring
|
|
462
472
|
- `active` - Reduced opacity
|
|
@@ -465,7 +475,11 @@ Buttons automatically handle:
|
|
|
465
475
|
**Example:**
|
|
466
476
|
|
|
467
477
|
```html
|
|
468
|
-
<button
|
|
478
|
+
<button
|
|
479
|
+
class="btn btn-fill"
|
|
480
|
+
disabled>
|
|
481
|
+
Disabled
|
|
482
|
+
</button>
|
|
469
483
|
```
|
|
470
484
|
|
|
471
485
|
#### Button Sizes
|
|
@@ -489,16 +503,14 @@ Buttons automatically handle:
|
|
|
489
503
|
#### Full Width Buttons
|
|
490
504
|
|
|
491
505
|
```html
|
|
492
|
-
<button class="btn btn-fill element-full
|
|
506
|
+
<button class="btn btn-fill element-w-full">Full Width</button>
|
|
493
507
|
```
|
|
494
508
|
|
|
495
509
|
#### Button with Data States
|
|
496
510
|
|
|
497
511
|
```html
|
|
498
512
|
<!-- Active state -->
|
|
499
|
-
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">
|
|
500
|
-
Toggle
|
|
501
|
-
</button>
|
|
513
|
+
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">Toggle</button>
|
|
502
514
|
```
|
|
503
515
|
|
|
504
516
|
---
|
|
@@ -511,7 +523,10 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
511
523
|
|
|
512
524
|
```html
|
|
513
525
|
<label class="input">
|
|
514
|
-
<input
|
|
526
|
+
<input
|
|
527
|
+
type="text"
|
|
528
|
+
class="input-field"
|
|
529
|
+
placeholder="Enter text" />
|
|
515
530
|
</label>
|
|
516
531
|
```
|
|
517
532
|
|
|
@@ -525,12 +540,18 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
525
540
|
```html
|
|
526
541
|
<!-- Outlined input -->
|
|
527
542
|
<label class="input input-outline">
|
|
528
|
-
<input
|
|
543
|
+
<input
|
|
544
|
+
type="text"
|
|
545
|
+
class="input-field"
|
|
546
|
+
placeholder="Outlined" />
|
|
529
547
|
</label>
|
|
530
548
|
|
|
531
549
|
<!-- Soft input -->
|
|
532
550
|
<label class="input input-soft">
|
|
533
|
-
<input
|
|
551
|
+
<input
|
|
552
|
+
type="text"
|
|
553
|
+
class="input-field"
|
|
554
|
+
placeholder="Soft" />
|
|
534
555
|
</label>
|
|
535
556
|
```
|
|
536
557
|
|
|
@@ -539,7 +560,10 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
539
560
|
```html
|
|
540
561
|
<label class="input input-outline">
|
|
541
562
|
<SearchIcon class="element-icon-size" />
|
|
542
|
-
<input
|
|
563
|
+
<input
|
|
564
|
+
type="text"
|
|
565
|
+
class="input-field"
|
|
566
|
+
placeholder="Search" />
|
|
543
567
|
</label>
|
|
544
568
|
```
|
|
545
569
|
|
|
@@ -547,15 +571,24 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
547
571
|
|
|
548
572
|
```html
|
|
549
573
|
<label class="input input-outline element-xs">
|
|
550
|
-
<input
|
|
574
|
+
<input
|
|
575
|
+
type="text"
|
|
576
|
+
class="input-field"
|
|
577
|
+
placeholder="XS" />
|
|
551
578
|
</label>
|
|
552
579
|
|
|
553
580
|
<label class="input input-outline element-sm">
|
|
554
|
-
<input
|
|
581
|
+
<input
|
|
582
|
+
type="text"
|
|
583
|
+
class="input-field"
|
|
584
|
+
placeholder="SM" />
|
|
555
585
|
</label>
|
|
556
586
|
|
|
557
587
|
<label class="input input-outline">
|
|
558
|
-
<input
|
|
588
|
+
<input
|
|
589
|
+
type="text"
|
|
590
|
+
class="input-field"
|
|
591
|
+
placeholder="Default" />
|
|
559
592
|
</label>
|
|
560
593
|
```
|
|
561
594
|
|
|
@@ -563,7 +596,9 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
563
596
|
|
|
564
597
|
```html
|
|
565
598
|
<label class="input input-outline">
|
|
566
|
-
<textarea
|
|
599
|
+
<textarea
|
|
600
|
+
class="input-field"
|
|
601
|
+
placeholder="Message"></textarea>
|
|
567
602
|
</label>
|
|
568
603
|
```
|
|
569
604
|
|
|
@@ -571,7 +606,9 @@ Inputs are built using `<label>` elements for better accessibility.
|
|
|
571
606
|
|
|
572
607
|
```html
|
|
573
608
|
<label class="input input-outline">
|
|
574
|
-
<input
|
|
609
|
+
<input
|
|
610
|
+
type="file"
|
|
611
|
+
class="input-field" />
|
|
575
612
|
</label>
|
|
576
613
|
```
|
|
577
614
|
|
|
@@ -584,9 +621,7 @@ Card component for content containers.
|
|
|
584
621
|
#### Base Card
|
|
585
622
|
|
|
586
623
|
```html
|
|
587
|
-
<div class="card">
|
|
588
|
-
Card content
|
|
589
|
-
</div>
|
|
624
|
+
<div class="card">Card content</div>
|
|
590
625
|
```
|
|
591
626
|
|
|
592
627
|
#### Card Variants
|
|
@@ -669,9 +704,7 @@ Alert component for notifications and messages.
|
|
|
669
704
|
#### Base Alert
|
|
670
705
|
|
|
671
706
|
```html
|
|
672
|
-
<div class="alert">
|
|
673
|
-
Alert message
|
|
674
|
-
</div>
|
|
707
|
+
<div class="alert">Alert message</div>
|
|
675
708
|
```
|
|
676
709
|
|
|
677
710
|
**Example:**
|
|
@@ -687,19 +720,13 @@ Alert component for notifications and messages.
|
|
|
687
720
|
|
|
688
721
|
```html
|
|
689
722
|
<!-- Error alert -->
|
|
690
|
-
<div class="alert palette-error">
|
|
691
|
-
Error occurred
|
|
692
|
-
</div>
|
|
723
|
+
<div class="alert palette-error">Error occurred</div>
|
|
693
724
|
|
|
694
725
|
<!-- Success alert -->
|
|
695
|
-
<div class="alert palette-success">
|
|
696
|
-
Operation successful
|
|
697
|
-
</div>
|
|
726
|
+
<div class="alert palette-success">Operation successful</div>
|
|
698
727
|
|
|
699
728
|
<!-- Info alert -->
|
|
700
|
-
<div class="alert palette-info">
|
|
701
|
-
Information message
|
|
702
|
-
</div>
|
|
729
|
+
<div class="alert palette-info">Information message</div>
|
|
703
730
|
```
|
|
704
731
|
|
|
705
732
|
---
|
|
@@ -778,14 +805,10 @@ Separate content with borders and spacing.
|
|
|
778
805
|
|
|
779
806
|
```html
|
|
780
807
|
<!-- Bottom separator -->
|
|
781
|
-
<div class="separate-b">
|
|
782
|
-
Content with bottom border and spacing
|
|
783
|
-
</div>
|
|
808
|
+
<div class="separate-b">Content with bottom border and spacing</div>
|
|
784
809
|
|
|
785
810
|
<!-- Vertical separator -->
|
|
786
|
-
<div class="separate-y">
|
|
787
|
-
Content with top and bottom borders
|
|
788
|
-
</div>
|
|
811
|
+
<div class="separate-y">Content with top and bottom borders</div>
|
|
789
812
|
```
|
|
790
813
|
|
|
791
814
|
---
|
|
@@ -797,26 +820,31 @@ Position elements relative to their container.
|
|
|
797
820
|
#### Individual Positions
|
|
798
821
|
|
|
799
822
|
**Top:**
|
|
823
|
+
|
|
800
824
|
- `top-center` - Center vertically, top edge
|
|
801
825
|
- `top-boundary` - Top boundary
|
|
802
826
|
- `top-out` - Outside top edge
|
|
803
827
|
|
|
804
828
|
**Right:**
|
|
829
|
+
|
|
805
830
|
- `right-center` - Center horizontally, right edge
|
|
806
831
|
- `right-boundary` - Right boundary
|
|
807
832
|
- `right-out` - Outside right edge
|
|
808
833
|
|
|
809
834
|
**Bottom:**
|
|
835
|
+
|
|
810
836
|
- `bottom-center` - Center vertically, bottom edge
|
|
811
837
|
- `bottom-boundary` - Bottom boundary
|
|
812
838
|
- `bottom-out` - Outside bottom edge
|
|
813
839
|
|
|
814
840
|
**Left:**
|
|
841
|
+
|
|
815
842
|
- `left-center` - Center horizontally, left edge
|
|
816
843
|
- `left-boundary` - Left boundary
|
|
817
844
|
- `left-out` - Outside left edge
|
|
818
845
|
|
|
819
846
|
**Center:**
|
|
847
|
+
|
|
820
848
|
- `inset-center` - Perfect center (top-center + left-center)
|
|
821
849
|
|
|
822
850
|
#### Compound Positions
|
|
@@ -834,9 +862,7 @@ Position elements relative to their container.
|
|
|
834
862
|
|
|
835
863
|
```html
|
|
836
864
|
<div class="relative">
|
|
837
|
-
<div class="absolute position-b card">
|
|
838
|
-
Popover content
|
|
839
|
-
</div>
|
|
865
|
+
<div class="absolute position-b card">Popover content</div>
|
|
840
866
|
</div>
|
|
841
867
|
```
|
|
842
868
|
|
|
@@ -847,9 +873,7 @@ Position elements relative to their container.
|
|
|
847
873
|
### Accordion
|
|
848
874
|
|
|
849
875
|
```html
|
|
850
|
-
<div class="accordion-body">
|
|
851
|
-
Accordion content
|
|
852
|
-
</div>
|
|
876
|
+
<div class="accordion-body">Accordion content</div>
|
|
853
877
|
```
|
|
854
878
|
|
|
855
879
|
---
|
|
@@ -862,13 +886,9 @@ Position elements relative to their container.
|
|
|
862
886
|
<!-- Body -->
|
|
863
887
|
<div class="modal-body">
|
|
864
888
|
<!-- Header -->
|
|
865
|
-
<div class="modal-header">
|
|
866
|
-
Modal Title
|
|
867
|
-
</div>
|
|
889
|
+
<div class="modal-header">Modal Title</div>
|
|
868
890
|
<!-- Content -->
|
|
869
|
-
<div class="modal-content">
|
|
870
|
-
Modal content
|
|
871
|
-
</div>
|
|
891
|
+
<div class="modal-content">Modal content</div>
|
|
872
892
|
</div>
|
|
873
893
|
</div>
|
|
874
894
|
```
|
|
@@ -881,9 +901,7 @@ Position elements relative to their container.
|
|
|
881
901
|
<!-- Portal (backdrop) -->
|
|
882
902
|
<div class="drawer-portal">
|
|
883
903
|
<!-- Body -->
|
|
884
|
-
<div class="drawer-body">
|
|
885
|
-
Drawer content
|
|
886
|
-
</div>
|
|
904
|
+
<div class="drawer-body">Drawer content</div>
|
|
887
905
|
</div>
|
|
888
906
|
```
|
|
889
907
|
|
|
@@ -901,9 +919,7 @@ Position elements relative to their container.
|
|
|
901
919
|
<div class="sheet-handlebar"></div>
|
|
902
920
|
</div>
|
|
903
921
|
<!-- Content -->
|
|
904
|
-
<div class="sheet-content">
|
|
905
|
-
Sheet content
|
|
906
|
-
</div>
|
|
922
|
+
<div class="sheet-content">Sheet content</div>
|
|
907
923
|
</div>
|
|
908
924
|
</div>
|
|
909
925
|
```
|
|
@@ -915,13 +931,12 @@ Position elements relative to their container.
|
|
|
915
931
|
```html
|
|
916
932
|
<div class="popover">
|
|
917
933
|
<button class="btn">Trigger</button>
|
|
918
|
-
<div class="popover-body position-b card">
|
|
919
|
-
Popover content
|
|
920
|
-
</div>
|
|
934
|
+
<div class="popover-body position-b card">Popover content</div>
|
|
921
935
|
</div>
|
|
922
936
|
```
|
|
923
937
|
|
|
924
938
|
**Position Classes:**
|
|
939
|
+
|
|
925
940
|
- `position-t` - Top
|
|
926
941
|
- `position-tr` - Top right
|
|
927
942
|
- `position-r` - Right
|
|
@@ -960,11 +975,16 @@ Position elements relative to their container.
|
|
|
960
975
|
```html
|
|
961
976
|
<div class="select-box-input input input-outline">
|
|
962
977
|
<ChevronDownIcon />
|
|
963
|
-
<input
|
|
978
|
+
<input
|
|
979
|
+
type="text"
|
|
980
|
+
class="input-field"
|
|
981
|
+
placeholder="Select..." />
|
|
964
982
|
<div class="select-box-list card card-y">
|
|
965
983
|
<div class="input input-outline">
|
|
966
984
|
<SearchIcon />
|
|
967
|
-
<input
|
|
985
|
+
<input
|
|
986
|
+
type="text"
|
|
987
|
+
class="input-field" />
|
|
968
988
|
</div>
|
|
969
989
|
<button class="select-box-option btn">Option 1</button>
|
|
970
990
|
<button class="select-box-option btn">Option 2</button>
|
|
@@ -1017,6 +1037,7 @@ Choice component for radio buttons, checkboxes, and switches.
|
|
|
1017
1037
|
**States:**
|
|
1018
1038
|
|
|
1019
1039
|
Use `data-state` attribute:
|
|
1040
|
+
|
|
1020
1041
|
- `data-state="true"` - Active/checked
|
|
1021
1042
|
- `data-state="false"` - Inactive/unchecked
|
|
1022
1043
|
|
|
@@ -1039,7 +1060,9 @@ Use `data-state` attribute:
|
|
|
1039
1060
|
|
|
1040
1061
|
```html
|
|
1041
1062
|
<div class="progress">
|
|
1042
|
-
<div
|
|
1063
|
+
<div
|
|
1064
|
+
class="progress-bar"
|
|
1065
|
+
style="width: 45%">
|
|
1043
1066
|
45%
|
|
1044
1067
|
</div>
|
|
1045
1068
|
</div>
|
|
@@ -1066,7 +1089,7 @@ Use `data-state` attribute:
|
|
|
1066
1089
|
<!-- Fade overlays -->
|
|
1067
1090
|
<div class="carousel-left-fade"></div>
|
|
1068
1091
|
<div class="carousel-right-fade"></div>
|
|
1069
|
-
|
|
1092
|
+
|
|
1070
1093
|
<!-- Container -->
|
|
1071
1094
|
<div class="carousel-container">
|
|
1072
1095
|
<div class="carousel-children card">Item 1</div>
|
|
@@ -1084,10 +1107,18 @@ Use `data-state` attribute:
|
|
|
1084
1107
|
```html
|
|
1085
1108
|
<nav class="breadcrumbs">
|
|
1086
1109
|
<div class="breadcrumbs-item">
|
|
1087
|
-
<a
|
|
1110
|
+
<a
|
|
1111
|
+
href="#"
|
|
1112
|
+
class="btn link"
|
|
1113
|
+
>Home</a
|
|
1114
|
+
>
|
|
1088
1115
|
</div>
|
|
1089
1116
|
<div class="breadcrumbs-item">
|
|
1090
|
-
<a
|
|
1117
|
+
<a
|
|
1118
|
+
href="#"
|
|
1119
|
+
class="btn link"
|
|
1120
|
+
>Articles</a
|
|
1121
|
+
>
|
|
1091
1122
|
</div>
|
|
1092
1123
|
<div class="breadcrumbs-item">
|
|
1093
1124
|
<span class="btn btn-fill">Current</span>
|
|
@@ -1101,9 +1132,15 @@ Use `data-state` attribute:
|
|
|
1101
1132
|
|
|
1102
1133
|
```html
|
|
1103
1134
|
<div class="otp">
|
|
1104
|
-
<input
|
|
1105
|
-
|
|
1106
|
-
|
|
1135
|
+
<input
|
|
1136
|
+
type="text"
|
|
1137
|
+
class="input input-outline input-square" />
|
|
1138
|
+
<input
|
|
1139
|
+
type="text"
|
|
1140
|
+
class="input input-outline input-square" />
|
|
1141
|
+
<input
|
|
1142
|
+
type="text"
|
|
1143
|
+
class="input input-outline input-square" />
|
|
1107
1144
|
</div>
|
|
1108
1145
|
```
|
|
1109
1146
|
|
|
@@ -1113,9 +1150,7 @@ Use `data-state` attribute:
|
|
|
1113
1150
|
|
|
1114
1151
|
```html
|
|
1115
1152
|
<div class="relative">
|
|
1116
|
-
<div class="show-more-content">
|
|
1117
|
-
Long content here...
|
|
1118
|
-
</div>
|
|
1153
|
+
<div class="show-more-content">Long content here...</div>
|
|
1119
1154
|
<div class="show-more-fade"></div>
|
|
1120
1155
|
<button class="btn">Show more</button>
|
|
1121
1156
|
</div>
|
|
@@ -1132,6 +1167,7 @@ Use `data-state` attribute:
|
|
|
1132
1167
|
```
|
|
1133
1168
|
|
|
1134
1169
|
**States:**
|
|
1170
|
+
|
|
1135
1171
|
- `data-state="false"` - Blurred (default)
|
|
1136
1172
|
- `data-state="true"` - Revealed
|
|
1137
1173
|
|
|
@@ -1146,6 +1182,7 @@ Use `data-state` attribute:
|
|
|
1146
1182
|
```
|
|
1147
1183
|
|
|
1148
1184
|
**States:**
|
|
1185
|
+
|
|
1149
1186
|
- `data-state="false"` - Hidden
|
|
1150
1187
|
- `data-state="true"` - Visible
|
|
1151
1188
|
|
|
@@ -1183,9 +1220,7 @@ Dark mode is supported via the `[data-theme="dark"]` attribute.
|
|
|
1183
1220
|
Use the `dark:` variant:
|
|
1184
1221
|
|
|
1185
1222
|
```html
|
|
1186
|
-
<div class="bg-background dark:bg-background-thick">
|
|
1187
|
-
Content
|
|
1188
|
-
</div>
|
|
1223
|
+
<div class="bg-background dark:bg-background-thick">Content</div>
|
|
1189
1224
|
```
|
|
1190
1225
|
|
|
1191
1226
|
---
|
|
@@ -1309,9 +1344,7 @@ Use `data-state` for component states:
|
|
|
1309
1344
|
|
|
1310
1345
|
```html
|
|
1311
1346
|
<!-- ✅ Good -->
|
|
1312
|
-
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">
|
|
1313
|
-
Toggle
|
|
1314
|
-
</button>
|
|
1347
|
+
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">Toggle</button>
|
|
1315
1348
|
```
|
|
1316
1349
|
|
|
1317
1350
|
---
|
|
@@ -1324,13 +1357,9 @@ This package is designed to work seamlessly with `@kadoui/react`:
|
|
|
1324
1357
|
import { Accordion } from "@kadoui/react";
|
|
1325
1358
|
|
|
1326
1359
|
<Accordion>
|
|
1327
|
-
<Accordion.Toggle className="btn btn-soft">
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
<Accordion.Body className="accordion-body">
|
|
1331
|
-
Content
|
|
1332
|
-
</Accordion.Body>
|
|
1333
|
-
</Accordion>
|
|
1360
|
+
<Accordion.Toggle className="btn btn-soft">Toggle</Accordion.Toggle>
|
|
1361
|
+
<Accordion.Body className="accordion-body">Content</Accordion.Body>
|
|
1362
|
+
</Accordion>;
|
|
1334
1363
|
```
|
|
1335
1364
|
|
|
1336
1365
|
See [@kadoui/react documentation](https://www.npmjs.com/package/@kadoui/react) for component usage.
|
package/package.json
CHANGED
package/src/styles/alert.css
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
@apply flex items-center bg-palette/10 text-palette border border-palette;
|
|
3
3
|
|
|
4
4
|
min-height: var(--element-h);
|
|
5
|
-
font-size: var(--element-text);
|
|
6
|
-
line-height: var(--element-line);
|
|
7
5
|
padding: var(--element-spacing);
|
|
8
6
|
gap: calc(var(--element-spacing));
|
|
9
7
|
border-radius: var(--element-rounded);
|
package/src/styles/badge.css
CHANGED
package/src/styles/base.css
CHANGED
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
/* Base styles */
|
|
2
|
-
|
|
3
|
-
@layer base {
|
|
4
|
-
html {
|
|
5
|
-
@apply scroll-smooth;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
body {
|
|
9
|
-
@apply bg-background text-foreground;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
* {
|
|
13
|
-
@apply select-none;
|
|
14
|
-
|
|
15
|
-
scrollbar-width: thin;
|
|
16
|
-
scrollbar-color: var(--color-foreground) transparent;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a,
|
|
20
|
-
span,
|
|
21
|
-
label {
|
|
22
|
-
@apply inline-block;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
button {
|
|
26
|
-
@apply cursor-pointer;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
input:focus,
|
|
30
|
-
textarea:focus {
|
|
31
|
-
@apply outline-none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
textarea {
|
|
35
|
-
@apply resize-none;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
1
|
/* Dark mode */
|
|
40
2
|
|
|
41
3
|
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
|
@@ -124,6 +86,47 @@
|
|
|
124
86
|
--element-rounded: var(--element-xl-rounded);
|
|
125
87
|
}
|
|
126
88
|
|
|
89
|
+
/* Base styles */
|
|
90
|
+
|
|
91
|
+
@layer base {
|
|
92
|
+
html {
|
|
93
|
+
@apply scroll-smooth;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
body {
|
|
97
|
+
@apply bg-background text-foreground;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
* {
|
|
101
|
+
@apply select-none;
|
|
102
|
+
|
|
103
|
+
scrollbar-width: thin;
|
|
104
|
+
scrollbar-color: var(--color-foreground) transparent;
|
|
105
|
+
|
|
106
|
+
font-size: var(--element-text);
|
|
107
|
+
line-height: var(--element-line);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
a,
|
|
111
|
+
span,
|
|
112
|
+
label {
|
|
113
|
+
@apply inline-block;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
button {
|
|
117
|
+
@apply cursor-pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
input:focus,
|
|
121
|
+
textarea:focus {
|
|
122
|
+
@apply outline-none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
textarea {
|
|
126
|
+
@apply resize-y;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
127
130
|
/* Use element sizes */
|
|
128
131
|
|
|
129
132
|
@utility element-square-size {
|
|
@@ -134,7 +137,7 @@
|
|
|
134
137
|
min-width: var(--element-w);
|
|
135
138
|
}
|
|
136
139
|
|
|
137
|
-
@utility element-full
|
|
140
|
+
@utility element-w-full {
|
|
138
141
|
--element-w: 100%;
|
|
139
142
|
}
|
|
140
143
|
|
|
@@ -145,6 +148,10 @@
|
|
|
145
148
|
min-height: calc(var(--element-h) / 2);
|
|
146
149
|
}
|
|
147
150
|
|
|
151
|
+
@utility element-rounded-full {
|
|
152
|
+
--element-rounded: calc(infinity * 1px);
|
|
153
|
+
}
|
|
154
|
+
|
|
148
155
|
/* Utilities */
|
|
149
156
|
|
|
150
157
|
@utility no-scrollbar {
|
|
@@ -155,6 +162,10 @@
|
|
|
155
162
|
@apply w-max max-w-full;
|
|
156
163
|
}
|
|
157
164
|
|
|
165
|
+
@utility h-fix {
|
|
166
|
+
@apply h-max max-h-full;
|
|
167
|
+
}
|
|
168
|
+
|
|
158
169
|
@utility link {
|
|
159
170
|
@apply underline decoration-transparent decoration-0 hover:decoration-palette focus-visible:decoration-palette;
|
|
160
171
|
}
|
package/src/styles/button.css
CHANGED
package/src/styles/card.css
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
@utility modal-portal {
|
|
2
|
-
@apply fixed inset-0 z-50
|
|
2
|
+
@apply fixed inset-0 z-50 p-(--element-spacing) flex bg-foreground/50;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
@utility modal-body {
|
|
6
|
-
@apply w-
|
|
6
|
+
@apply w-fix h-fix flex flex-col;
|
|
7
|
+
|
|
8
|
+
&:has(.modal-header) .modal-content {
|
|
9
|
+
@apply rounded-t-none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:has(.modal-footer) .modal-content {
|
|
13
|
+
@apply rounded-b-none;
|
|
14
|
+
}
|
|
7
15
|
}
|
|
8
16
|
|
|
9
17
|
@utility modal-header {
|
|
10
|
-
@apply
|
|
18
|
+
@apply min-h-(--element-h) flex items-center p-(--element-spacing) gap-(--element-spacing) bg-background rounded-t-(--element-rounded) border-b border-background-thin sticky top-0 shrink-0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@utility modal-footer {
|
|
22
|
+
@apply min-h-(--element-h) flex items-center p-(--element-spacing) gap-(--element-spacing) bg-background rounded-b-(--element-rounded) border-t border-background-thin sticky bottom-0 shrink-0;
|
|
11
23
|
}
|
|
12
24
|
|
|
13
25
|
@utility modal-content {
|
|
14
|
-
@apply w-full
|
|
26
|
+
@apply w-full p-(--element-spacing) bg-background rounded-(--element-rounded) overflow-y-auto;
|
|
15
27
|
}
|
package/src/styles/input.css
CHANGED