@kadoui/tailwindcss 1.1.0 → 1.2.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/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,26 +84,26 @@ 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
- --element-xs-h: calc(var(--spacing) * 6);
94
- --element-sm-h: calc(var(--spacing) * 8);
95
- --element-medium-h: calc(var(--spacing) * 10);
96
- --element-lg-h: calc(var(--spacing) * 12);
97
- --element-xl-h: calc(var(--spacing) * 14);
98
-
93
+ --element-xs-size: calc(var(--spacing) * 6);
94
+ --element-sm-size: calc(var(--spacing) * 8);
95
+ --element-medium-size: calc(var(--spacing) * 10);
96
+ --element-lg-size: calc(var(--spacing) * 12);
97
+ --element-xl-size: calc(var(--spacing) * 14);
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
- --element-h: var(--element-medium-h);
106
+ --element-size: var(--element-medium-size);
107
107
  --element-spacing: var(--element-medium-spacing);
108
108
  --element-text: var(--text-base);
109
109
  --element-leading: var(--text-base--line-height);
@@ -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 | Usage |
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) | 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 |
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` | 640px | Mobile |
196
- | `md` | 768px | Tablet |
197
- | `lg` | 1024px | Desktop |
198
- | `xl` | 1280px | Large desktop |
199
- | `2xl` | 1536px | Extra large desktop |
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,7 +278,8 @@ 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:
280
- - `--element-h` - Height
281
+
282
+ - `--element-size` - Height
281
283
  - `--element-spacing` - Padding/spacing
282
284
  - `--element-text` - Font size
283
285
  - `--element-leading` - Line height
@@ -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-w` - Full width element
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-w">Full Width</button>
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 | Value |
323
- |-------|-------|-------|
324
- | lvl-1 | `rounded` | Small radius |
325
- | lvl-2 | `rounded-md` | Medium radius |
326
- | lvl-3 | `rounded-lg` | Large radius |
327
- | lvl-4 | `rounded-xl` | Extra large radius |
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 href="#" class="link">Link text</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 class="btn btn-fill" disabled>Disabled</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-w">Full Width</button>
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 type="text" class="input-field" placeholder="Enter text" />
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 type="text" class="input-field" placeholder="Outlined" />
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 type="text" class="input-field" placeholder="Soft" />
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 type="text" class="input-field" placeholder="Search" />
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 type="text" class="input-field" placeholder="XS" />
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 type="text" class="input-field" placeholder="SM" />
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 type="text" class="input-field" placeholder="Default" />
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 class="input-field" placeholder="Message"></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 type="file" class="input-field" />
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 type="text" class="input-field" placeholder="Select..." />
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 type="text" class="input-field" />
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 class="progress-bar" style="width: 45%">
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 href="#" class="btn link">Home</a>
1110
+ <a
1111
+ href="#"
1112
+ class="btn link"
1113
+ >Home</a
1114
+ >
1088
1115
  </div>
1089
1116
  <div class="breadcrumbs-item">
1090
- <a href="#" class="btn link">Articles</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 type="text" class="input input-outline input-square" />
1105
- <input type="text" class="input input-outline input-square" />
1106
- <input type="text" class="input input-outline input-square" />
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
  ---
@@ -1235,7 +1270,7 @@ Use the `dark:` variant:
1235
1270
  }
1236
1271
 
1237
1272
  @utility element-xxl {
1238
- --element-h: var(--element-xxl-h);
1273
+ --element-size: var(--element-xxl-h);
1239
1274
  --element-spacing: var(--element-xxl-spacing);
1240
1275
  --element-text: var(--element-xxl-text);
1241
1276
  --element-leading: var(--element-xxl-leading);
@@ -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
- Toggle
1329
- </Accordion.Toggle>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadoui/tailwindcss",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Kadoui TailwindCSS styles",
5
5
  "author": "FarzadVav",
6
6
  "license": "MIT",
@@ -1,9 +1,7 @@
1
1
  @utility alert {
2
2
  @apply flex items-center bg-palette/10 text-palette border border-palette;
3
3
 
4
- min-height: var(--element-h);
5
- font-size: var(--element-text);
6
- line-height: var(--element-line);
4
+ min-height: var(--element-size);
7
5
  padding: var(--element-spacing);
8
6
  gap: calc(var(--element-spacing));
9
7
  border-radius: var(--element-rounded);
@@ -4,12 +4,10 @@
4
4
  @apply flex items-center justify-center max-w-full;
5
5
 
6
6
  width: var(--element-w);
7
- height: var(--element-h);
7
+ height: var(--element-size);
8
8
  padding: 0 var(--element-spacing);
9
9
  gap: calc(var(--element-spacing) / 1.5);
10
10
  border-radius: var(--element-rounded);
11
- font-size: var(--element-text);
12
- line-height: var(--element-line);
13
11
  }
14
12
 
15
13
  @utility badge-fill {
@@ -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] *));
@@ -85,64 +47,123 @@
85
47
  /* Element sizes */
86
48
 
87
49
  @utility element-xs {
88
- --element-h: var(--element-xs-h);
50
+ --element-size: var(--element-xs-size);
89
51
  --element-spacing: var(--element-xs-spacing);
90
52
  --element-text: var(--element-xs-text);
91
53
  --element-leading: var(--element-xs-leading);
92
- --element-rounded: var(--element-xs-rounded);
54
+
55
+ &:not(*:is(.element-rounded-full)) {
56
+ --element-rounded: var(--element-xs-rounded);
57
+ }
93
58
  }
94
59
 
95
60
  @utility element-sm {
96
- --element-h: var(--element-sm-h);
61
+ --element-size: var(--element-sm-size);
97
62
  --element-spacing: var(--element-sm-spacing);
98
63
  --element-text: var(--element-sm-text);
99
64
  --element-leading: var(--element-sm-leading);
100
- --element-rounded: var(--element-sm-rounded);
65
+
66
+ &:not(*:is(.element-rounded-full)) {
67
+ --element-rounded: var(--element-sm-rounded);
68
+ }
101
69
  }
102
70
 
103
71
  @utility element-md {
104
- --element-h: var(--element-medium-h);
72
+ --element-size: var(--element-medium-size);
105
73
  --element-spacing: var(--element-medium-spacing);
106
74
  --element-text: var(--element-medium-text);
107
75
  --element-leading: var(--element-medium-leading);
108
- --element-rounded: var(--element-medium-rounded);
76
+
77
+ &:not(*:is(.element-rounded-full)) {
78
+ --element-rounded: var(--element-medium-rounded);
79
+ }
109
80
  }
110
81
 
111
82
  @utility element-lg {
112
- --element-h: var(--element-lg-h);
83
+ --element-size: var(--element-lg-size);
113
84
  --element-spacing: var(--element-lg-spacing);
114
85
  --element-text: var(--element-lg-text);
115
86
  --element-leading: var(--element-lg-leading);
116
- --element-rounded: var(--element-lg-rounded);
87
+
88
+ &:not(*:is(.element-rounded-full)) {
89
+ --element-rounded: var(--element-lg-rounded);
90
+ }
117
91
  }
118
92
 
119
93
  @utility element-xl {
120
- --element-h: var(--element-xl-h);
94
+ --element-size: var(--element-xl-size);
121
95
  --element-spacing: var(--element-xl-spacing);
122
96
  --element-text: var(--element-xl-text);
123
97
  --element-leading: var(--element-xl-leading);
124
- --element-rounded: var(--element-xl-rounded);
98
+
99
+ &:not(*:is(.element-rounded-full)) {
100
+ --element-rounded: var(--element-xl-rounded);
101
+ }
102
+ }
103
+
104
+ /* Base styles */
105
+
106
+ @layer base {
107
+ html {
108
+ @apply scroll-smooth;
109
+ }
110
+
111
+ body {
112
+ @apply bg-background text-foreground;
113
+ }
114
+
115
+ * {
116
+ @apply select-none;
117
+
118
+ scrollbar-width: thin;
119
+ scrollbar-color: var(--color-foreground) transparent;
120
+
121
+ font-size: var(--element-text);
122
+ line-height: var(--element-line);
123
+ }
124
+
125
+ a,
126
+ span,
127
+ label {
128
+ @apply inline-block;
129
+ }
130
+
131
+ button {
132
+ @apply cursor-pointer;
133
+ }
134
+
135
+ input:focus,
136
+ textarea:focus {
137
+ @apply outline-none;
138
+ }
139
+
140
+ textarea {
141
+ @apply resize-y;
142
+ }
125
143
  }
126
144
 
127
145
  /* Use element sizes */
128
146
 
129
147
  @utility element-square-size {
130
- --element-w: var(--element-h);
148
+ --element-w: min(var(--element-size), var(--element-size));
131
149
  --element-spacing: 0;
132
150
 
133
- text-align: center;
134
- min-width: var(--element-w);
151
+ @apply text-center justify-center items-center;
135
152
  }
136
153
 
137
- @utility element-full-w {
154
+ @utility element-w-full {
138
155
  --element-w: 100%;
139
156
  }
140
157
 
141
158
  @utility element-icon-size {
142
- width: calc(var(--element-h) / 2);
143
- min-width: calc(var(--element-h) / 2);
144
- height: calc(var(--element-h) / 2);
145
- min-height: calc(var(--element-h) / 2);
159
+ width: calc(var(--element-size) / 2);
160
+ min-width: calc(var(--element-size) / 2);
161
+ height: calc(var(--element-size) / 2);
162
+ min-height: calc(var(--element-size) / 2);
163
+ }
164
+
165
+ @utility element-rounded-full {
166
+ --element-rounded: calc(infinity * 1px);
146
167
  }
147
168
 
148
169
  /* Utilities */
@@ -155,6 +176,10 @@
155
176
  @apply w-max max-w-full;
156
177
  }
157
178
 
179
+ @utility h-fix {
180
+ @apply h-max max-h-full;
181
+ }
182
+
158
183
  @utility link {
159
184
  @apply underline decoration-transparent decoration-0 hover:decoration-palette focus-visible:decoration-palette;
160
185
  }
@@ -1,15 +1,13 @@
1
1
  @utility btn {
2
- --element-w: max-content;
2
+ --element-w: min(max-content, 100%);
3
3
 
4
- @apply max-w-full flex items-center justify-center transition-all outline-solid outline-2 outline-transparent focus-visible:outline-palette disabled:opacity-50 disabled:cursor-not-allowed active:opacity-50;
4
+ @apply flex items-center justify-center transition-all outline-solid outline-2 outline-transparent focus-visible:outline-palette disabled:opacity-50 disabled:cursor-not-allowed active:opacity-50;
5
5
 
6
6
  width: var(--element-w);
7
- height: var(--element-h);
7
+ height: var(--element-size);
8
8
  padding: 0 var(--element-spacing);
9
9
  gap: calc(var(--element-spacing) / 1.5);
10
10
  border-radius: var(--element-rounded);
11
- font-size: var(--element-text);
12
- line-height: var(--element-line);
13
11
  }
14
12
 
15
13
  @utility btn-fill {
@@ -1,8 +1,6 @@
1
1
  @utility card {
2
2
  padding: var(--element-spacing);
3
3
  border-radius: var(--element-rounded);
4
- font-size: var(--element-text);
5
- line-height: var(--element-line);
6
4
  }
7
5
 
8
6
  @utility card-menu {
@@ -5,8 +5,8 @@
5
5
  @utility choice-radio {
6
6
  @apply rounded-full flex items-center justify-center;
7
7
 
8
- width: var(--element-h);
9
- height: var(--element-h);
8
+ width: var(--element-size);
9
+ height: var(--element-size);
10
10
 
11
11
  &[data-state="false"]>.choice-radio-trigger {
12
12
  @apply opacity-0 scale-0;
@@ -16,15 +16,15 @@
16
16
  @utility choice-radio-trigger {
17
17
  @apply bg-palette rounded-full transition-all flex items-center justify-center text-brush;
18
18
 
19
- width: calc(var(--element-h) - 0.5rem);
20
- height: calc(var(--element-h) - 0.5rem);
19
+ width: calc(var(--element-size) - 0.5rem);
20
+ height: calc(var(--element-size) - 0.5rem);
21
21
  }
22
22
 
23
23
  @utility choice-checkbox {
24
24
  @apply rounded-(--element-rounded) flex items-center justify-center;
25
25
 
26
- width: var(--element-h);
27
- height: var(--element-h);
26
+ width: var(--element-size);
27
+ height: var(--element-size);
28
28
 
29
29
  &[data-state="false"]>.choice-checkbox-trigger {
30
30
  @apply opacity-0 scale-0;
@@ -34,15 +34,15 @@
34
34
  @utility choice-checkbox-trigger {
35
35
  @apply bg-palette rounded-[calc(var(--element-rounded)-0.25rem)] transition-all flex items-center justify-center text-brush;
36
36
 
37
- width: calc(var(--element-h) - 0.5rem);
38
- height: calc(var(--element-h) - 0.5rem);
37
+ width: calc(var(--element-size) - 0.5rem);
38
+ height: calc(var(--element-size) - 0.5rem);
39
39
  }
40
40
 
41
41
  @utility choice-switch {
42
42
  @apply relative rounded-full flex items-center;
43
43
 
44
- width: calc(var(--element-h) * 2);
45
- height: var(--element-h);
44
+ width: calc(var(--element-size) * 2);
45
+ height: var(--element-size);
46
46
 
47
47
  &[data-state="true"] {
48
48
  @apply bg-palette text-brush;
@@ -50,7 +50,7 @@
50
50
  &>.choice-switch-trigger {
51
51
  @apply bg-brush text-palette;
52
52
 
53
- left: calc(var(--element-h) + 0.25rem);
53
+ left: calc(var(--element-size) + 0.25rem);
54
54
  }
55
55
  }
56
56
 
@@ -64,6 +64,6 @@
64
64
  @utility choice-switch-trigger {
65
65
  @apply absolute rounded-full transition-all flex items-center justify-center;
66
66
 
67
- width: calc(var(--element-h) - 0.5rem);
68
- height: calc(var(--element-h) - 0.5rem);
67
+ width: calc(var(--element-size) - 0.5rem);
68
+ height: calc(var(--element-size) - 0.5rem);
69
69
  }
@@ -1,15 +1,27 @@
1
1
  @utility modal-portal {
2
- @apply fixed inset-0 z-50 flex items-center justify-center bg-foreground/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-max max-w-[90%] h-full max-h-[90%] flex items-center justify-center flex-col;
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 w-full h-[calc(var(--element-h)*1.5)] flex items-center px-(--element-spacing) bg-background rounded-t-(--element-rounded) border-b border-background-thin sticky top-0;
18
+ @apply min-h-(--element-size) 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-size) 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 py-(--element-spacing) px-(--element-spacing) bg-background rounded-b-(--element-rounded) max-h-[calc(100%-(var(--element-h)*1.5))] overflow-y-auto;
26
+ @apply w-full p-(--element-spacing) bg-background rounded-(--element-rounded) overflow-y-auto;
15
27
  }
@@ -1,5 +1,5 @@
1
1
  @utility progress {
2
- @apply w-full rounded-(--element-rounded) overflow-hidden h-(--element-h) bg-palette/10;
2
+ @apply w-full rounded-(--element-rounded) overflow-hidden h-(--element-size) bg-palette/10;
3
3
  }
4
4
 
5
5
  @utility progress-bar {
@@ -7,5 +7,5 @@
7
7
  }
8
8
 
9
9
  @utility select-box-option {
10
- @apply btn element-full-w justify-start;
10
+ @apply btn element-w-full justify-start;
11
11
  }
@@ -6,9 +6,7 @@
6
6
  @apply text-palette flex cursor-text relative transition-all outline-solid outline-2 outline-transparent focus-within:outline-palette disabled:opacity-50 disabled:cursor-not-allowed has-[[type=file]]:cursor-pointer;
7
7
 
8
8
  width: var(--element-w);
9
- height: var(--element-h);
10
- font-size: var(--element-text);
11
- line-height: var(--element-line);
9
+ height: var(--element-size);
12
10
  border-radius: var(--element-rounded);
13
11
  padding: var(--element-spacing);
14
12
  gap: var(--element-spacing);
@@ -3,8 +3,6 @@
3
3
 
4
4
  padding: var(--element-spacing);
5
5
  border-radius: var(--element-rounded);
6
- font-size: var(--element-text);
7
- line-height: var(--element-line);
8
6
  box-shadow: 0 2px 0 1px var(--color-palette);
9
7
 
10
8
  &:active {