gladvn 0.2.15 → 0.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gladvn",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "type": "module",
5
5
  "description": "DO NOT 'npm install'. Use 'npx gladvn init' instead! A highly composable React component library built with Tailwind CSS.",
6
6
  "keywords": [
@@ -12,6 +12,11 @@
12
12
  "radix-ui"
13
13
  ],
14
14
  "license": "MIT",
15
+ "homepage": "https://gladvn.vercel.app",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/duongacy/gladcn"
19
+ },
15
20
  "main": "./dist/index.cjs",
16
21
  "module": "./dist/index.js",
17
22
  "types": "./dist/index.d.ts",
@@ -78,6 +78,12 @@ function ComboboxInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
78
78
  data-slot="combobox-input"
79
79
  className={cn(
80
80
  "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
81
+ // Clear standalone styles when inside InputGroup
82
+ "group-data-[slot=input-group]/input-group:border-0",
83
+ "group-data-[slot=input-group]/input-group:shadow-none",
84
+ "group-data-[slot=input-group]/input-group:h-auto",
85
+ "group-data-[slot=input-group]/input-group:rounded-none",
86
+ "group-data-[slot=input-group]/input-group:focus-visible:ring-0",
81
87
  className,
82
88
  )}
83
89
  {...props}
@@ -224,9 +224,9 @@ const InputGroupInput = React.forwardRef<
224
224
  data-slot="input-group-control"
225
225
  className={cn(
226
226
  "min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",
227
- "group-data-[size=sm]/input-group:h-7 group-data-[size=sm]/input-group:px-2 group-data-[size=sm]/input-group:py-0.5 group-data-[size=sm]/input-group:text-xs",
228
- "group-data-[size=md]/input-group:h-8 group-data-[size=md]/input-group:px-2.5 group-data-[size=md]/input-group:py-1 group-data-[size=md]/input-group:text-sm",
229
- "group-data-[size=lg]/input-group:h-9 group-data-[size=lg]/input-group:px-3 group-data-[size=lg]/input-group:py-1.5 group-data-[size=lg]/input-group:text-sm",
227
+ "group-data-[size=sm]/input-group:px-2 group-data-[size=sm]/input-group:py-0.5 group-data-[size=sm]/input-group:text-xs",
228
+ "group-data-[size=md]/input-group:px-2.5 group-data-[size=md]/input-group:py-1 group-data-[size=md]/input-group:text-sm",
229
+ "group-data-[size=lg]/input-group:px-3 group-data-[size=lg]/input-group:py-1.5 group-data-[size=lg]/input-group:text-sm",
230
230
  className,
231
231
  )}
232
232
  {...props}
@@ -129,10 +129,10 @@ export default function OverviewSection() {
129
129
  style={{ animationDelay: "100ms", animationFillMode: "both" }}
130
130
  >
131
131
  <span className="block text-foreground drop-shadow-sm">
132
- Mọi component.
132
+ Tinh tế. Đẳng cấp.
133
133
  </span>
134
134
  <span className="block mt-2 bg-gradient-to-r leading-[1.2] from-primary via-info to-primary bg-[length:200%_auto] bg-clip-text text-transparent animate-[spin_8s_linear_infinite] [animation-name:gradient] [animation-duration:8s] [animation-timing-function:linear] [animation-iteration-count:infinite]">
135
- Trong thư mục của bạn.
135
+ Sạch sẽ.
136
136
  </span>
137
137
  </h1>
138
138
 
@@ -140,11 +140,11 @@ export default function OverviewSection() {
140
140
  className="max-w-2xl text-lg md:text-xl text-muted-foreground leading-relaxed mb-10 animate-fade-up"
141
141
  style={{ animationDelay: "200ms", animationFillMode: "both" }}
142
142
  >
143
- Component library thường đòi bạn follow quy tắc của họ mãi mãi.
144
- gladvn đặt toàn bộ source code vào tay bạn ngay từ đầu —{" "}
143
+ Đa số component library bắt bạn phải phụ thuộc vào họ mãi mãi.
144
+ gladvn copy thẳng source code vào dự án của bạn —{" "}
145
145
  <strong className="text-foreground">
146
- không vendor lock-in, không breaking change bất ngờ, không
147
- node_modules ẩn.
146
+ không node_modules ẩn, không breaking change bất ngờ, không
147
+ vendor lock-in.
148
148
  </strong>
149
149
  </p>
150
150
  </div>
@@ -302,15 +302,14 @@ export default function OverviewSection() {
302
302
  <section className="container max-w-6xl mx-auto space-y-12 px-4">
303
303
  <div className="text-center max-w-2xl mx-auto space-y-4">
304
304
  <h2 className="text-3xl md:text-4xl font-extrabold tracking-tight">
305
- Tường minh từ thiết kế. Bền vững theo thời gian.
305
+ ràng từ đầu. Dùng lâu không sợ vỡ.
306
306
  </h2>
307
307
  <p className="text-muted-foreground text-lg">
308
- Phần lớn component library hỏng ở năm thứ hai — khi team cần thay
309
- đổi nhưng không ai dám sửa vì không biết gì sẽ vỡ. gladvn được xây
310
- trên{" "}
311
- <strong className="text-foreground">Các nguyên tắc tường minh</strong>
312
- {" "}để bạn luôn biết mình đang sửa ở tầng nào điều sẽ bị ảnh
313
- hưởng.
308
+ Nhiều dự án bắt đầu gãy ở năm thứ hai — ai cũng muốn sửa nhưng
309
+ không ai dám sửa vì không biết cái gì sẽ hỏng theo. gladvn chia code
310
+ thành{" "}
311
+ <strong className="text-foreground">các tầng ràng</strong>
312
+ {", "}nên bạn luôn biết mình đang sửa ở đâuảnh hưởng đến đâu.
314
313
  </p>
315
314
  </div>
316
315
 
@@ -325,19 +324,19 @@ export default function OverviewSection() {
325
324
  <SparklesIcon className="size-4" /> Điểm khác biệt lớn nhất
326
325
  </div>
327
326
  <h3 className="text-3xl md:text-5xl font-extrabold tracking-tight">
328
- Sở hữu 100% mã nguồn
327
+ Code của bạn, 100%
329
328
  </h3>
330
329
  <p className="text-muted-foreground text-lg leading-relaxed max-w-2xl">
331
- Chạy một lệnh duy nhất — toàn bộ source code (components, hooks,
332
- styles, contexts) được sao chép thẳng vào thư mục{" "}
330
+ Chạy một lệnh — toàn bộ components, hooks, styles, contexts
331
+ được copy thẳng vào thư mục{" "}
333
332
  <code className="text-sm bg-primary/20 text-primary px-1.5 py-0.5 rounded">
334
333
  src/
335
334
  </code>{" "}
336
- của dự án bạn.{" "}
335
+ của bạn.{" "}
337
336
  <strong className="text-foreground">
338
- Không cài qua node_modules, không bị vendor lock-in
337
+ Không qua node_modules, không bị khóa vào bất kỳ ai
339
338
  </strong>{" "}
340
- — bạn đọc được, sửa được, xoá được từng dòng code.
339
+ — bạn đọc được, sửa được, xoá được từng dòng.
341
340
  </p>
342
341
 
343
342
  <div className="flex items-center gap-4 pt-2">
@@ -423,13 +422,13 @@ export default function OverviewSection() {
423
422
  Sửa Macro — an toàn nhất
424
423
  </h4>
425
424
  <p className="text-sm text-muted-foreground leading-relaxed">
426
- Đây nơi bạn nên chỉnh trước tiên. Mỗi Macro là một preset
427
- độc lập — thêm footer cho DatePicker, bỏ nút đóng của Dialog,
428
- điều chỉnh placeholder của Combobox.{" "}
425
+ Bắt đầu đây. Mỗi Macro là một preset độc lập — thêm footer
426
+ cho DatePicker, bỏ nút đóng của Dialog, chỉnh placeholder
427
+ Combobox.{" "}
429
428
  <strong className="text-foreground">
430
- Thay đổi chỉ ảnh hưởng đúng preset đó
429
+ Sửa cái nào chỉ ảnh hưởng cái đó
431
430
  </strong>
432
- , không lan ra component nào khác.
431
+ , không lan sang đâu cả.
433
432
  </p>
434
433
  </div>
435
434
 
@@ -442,15 +441,15 @@ export default function OverviewSection() {
442
441
  src/components/micro/
443
442
  </div>
444
443
  <h4 className="font-bold text-foreground text-base">
445
- Sửa Micro — ảnh hưởng rộng
444
+ Sửa Micro — cẩn thận hơn
446
445
  </h4>
447
446
  <p className="text-sm text-muted-foreground leading-relaxed">
448
- Micro là nền tảng — mọi Macro đều xây trên chúng. Sửa một
449
- variant của Button hay thay animation của Tooltip sẽ{" "}
447
+ Micro là nền — mọi Macro đều xây trên nó. Sửa variant của
448
+ Button hay animation của Tooltip thì{" "}
450
449
  <strong className="text-foreground">
451
- tác động đồng loạt đến toàn bộ nơi dùng component đó
452
- </strong>{" "}
453
- trong ứng dụng. Chỉ chỉnh khi bạn rõ mình đang làm gì.
450
+ tất cả nơi dùng component đó đều thay đổi theo
451
+ </strong>
452
+ . Chỉ sửa khi bạn rõ mình đang làm gì.
454
453
  </p>
455
454
  </div>
456
455
 
@@ -463,16 +462,15 @@ export default function OverviewSection() {
463
462
  src/index.css
464
463
  </div>
465
464
  <h4 className="font-bold text-foreground text-base">
466
- Sửa CSS — chạm toàn bộ hệ thống
465
+ Sửa CSS — ảnh hưởng toàn bộ
467
466
  </h4>
468
467
  <p className="text-sm text-muted-foreground leading-relaxed">
469
- CSS token ngôn ngữ chung của mọi component — màu sắc,
470
- typography, border-radius. Thay đổi một token ở đây{" "}
468
+ CSS token quyết định màu, font, border-radius cho tất cả.
469
+ Đổi một token ở đây thì{" "}
471
470
  <strong className="text-foreground">
472
- tức thời cập nhật toàn bộ giao diện
471
+ toàn bộ giao diện cập nhật ngay
473
472
  </strong>
474
- , từ Button đến Dialog. Dùng khi bạn muốn rebrand hoặc thay
475
- đổi design language, không phải để vá từng chỗ.
473
+ . Dùng khi muốn rebrand, không phải để vá lỗi lẻ tẻ.
476
474
  </p>
477
475
  </div>
478
476
 
@@ -488,15 +486,13 @@ export default function OverviewSection() {
488
486
  </div>
489
487
  <div className="relative z-10 space-y-4 mb-10">
490
488
  <h3 className="text-2xl md:text-4xl font-extrabold tracking-tight">
491
- Micro &amp; Macro Architecture
489
+ Micro & Macro
492
490
  </h3>
493
491
  <p className="text-muted-foreground max-w-lg text-lg leading-relaxed">
494
- Tách biệt ràng Core components linh hoạt (Micro) các
495
- pattern tiện dụng (Macro).
496
- <strong className="text-foreground">
497
- Micro tuyệt đối không áp đặt layout phức tạp (Opinionated).
498
- Mọi logic lắp ráp giao diện đều phải uỷ quyền (Delegate) hoàn
499
- toàn cho Macro.
492
+ Micro component thuần chỉ lo style, không ép layout.
493
+ Macro preset — lắp ghép Micro thành giao diện hoàn chỉnh.
494
+ <strong className="text-foreground block mt-2">
495
+ Micro không bao giờ tự quyết layout. Việc đó thuộc về Macro.
500
496
  </strong>
501
497
  </p>
502
498
  </div>
@@ -560,12 +556,11 @@ export default function OverviewSection() {
560
556
  Style Encapsulation
561
557
  </h3>
562
558
  <p className="text-muted-foreground text-base leading-relaxed">
563
- Mỗi component là một hộp đen styling. Consumer chỉ tác động
564
- vào bên trong qua{" "}
565
- <code>data-slot</code> — contract đã được khai báo chính thức
566
- trong API.{" "}
559
+ Mỗi component là một hộp kín về style. Muốn tuỳ chỉnh từ ngoài
560
+ thì dùng{" "}
561
+ <code>data-slot</code> — đã sẵn contract ràng.{" "}
567
562
  <strong className="text-foreground">
568
- Refactor nội tại không bao giờ phá vỡ code của người dùng.
563
+ Refactor bên trong thoải mái không phá code bên ngoài.
569
564
  </strong>
570
565
  </p>
571
566
  </div>
@@ -588,11 +583,11 @@ export default function OverviewSection() {
588
583
  </div>
589
584
  <div className="relative z-10 space-y-4">
590
585
  <h3 className="text-2xl md:text-4xl font-extrabold tracking-tight">
591
- Orthogonal Styling
586
+ Variant × Color
592
587
  </h3>
593
588
  <p className="text-muted-foreground text-lg leading-relaxed max-w-lg">
594
- Tách biệt ràng trục cấu trúc (Variant) và trục màu sắc
595
- (Color) thành các style độc lập, giúp tránh bùng nổ tổ hợp CSS
589
+ Variant (solid, outline, ghost...) và Color (primary, destructive...)
590
+ hai trục hoàn toàn độc lập. Kết hợp tự do không bị bùng nổ
596
591
  class.
597
592
  </p>
598
593
  </div>
@@ -629,10 +624,10 @@ export default function OverviewSection() {
629
624
  Zero-prop Defaults
630
625
  </h3>
631
626
  <p className="text-muted-foreground text-lg leading-relaxed max-w-lg">
632
- Component phải hoạt động mượt render đúng UI chuẩn kể cả
633
- khi dev không truyền bất kỳ prop nào vào.{" "}
627
+ Quẳng component vào không truyền prop nào vẫn chạy đẹp,
628
+ vẫn đúng behavior.{" "}
634
629
  <strong className="text-foreground">
635
- Nếu không, mỗi lần dùng là một lần tra tài liệu.
630
+ Không phải tra docs mỗi lần dùng.
636
631
  </strong>
637
632
  </p>
638
633
  </div>
@@ -661,14 +656,13 @@ export default function OverviewSection() {
661
656
  </div>
662
657
  <div className="relative z-10 space-y-4">
663
658
  <h3 className="text-2xl font-extrabold tracking-tight">
664
- Headless Behavior Layer
659
+ Headless + Style
665
660
  </h3>
666
661
  <p className="text-muted-foreground text-base leading-relaxed">
667
- Keyboard navigation, focus management, ARIA state tất cả được
668
- tách sang lớp Headless UI (Base UI). Micro component chỉ wrap
669
- và thêm visual style, không tự implement logic tương tác.{" "}
662
+ Keyboard, focus, ARIA — Base UI lo hết. Micro component chỉ
663
+ thêm lớp style lên trên, không tự viết logic tương tác.{" "}
670
664
  <strong className="text-foreground">
671
- Behavior đúng mặc định, không cần test lại từng lần.
665
+ Behavior đúng sẵn, không cần test lại.
672
666
  </strong>
673
667
  </p>
674
668
  </div>
@@ -693,14 +687,13 @@ export default function OverviewSection() {
693
687
  </div>
694
688
  <div className="relative z-10 space-y-4">
695
689
  <h3 className="text-2xl md:text-4xl font-extrabold tracking-tight">
696
- CSS Token Architecture
690
+ CSS Token
697
691
  </h3>
698
692
  <p className="text-muted-foreground text-lg leading-relaxed max-w-lg">
699
- Không component nào được hardcode màu sắc, spacing hay
700
- border-radius trực tiếp. Tất cả tham chiếu CSS custom property
701
- từ hệ thống token.{" "}
693
+ Không component nào hardcode màu hay spacing. Tất cả đều
694
+ tham chiếu từ hệ thống token chung.{" "}
702
695
  <strong className="text-foreground">
703
- Thay đổi một token — toàn hệ thống cập nhật tức thì.
696
+ Đổi một token — cả app cập nhật.
704
697
  </strong>
705
698
  </p>
706
699
  </div>
@@ -727,11 +720,12 @@ export default function OverviewSection() {
727
720
  </div>
728
721
  <div className="relative z-10 space-y-4">
729
722
  <h3 className="text-2xl font-extrabold tracking-tight">
730
- Strict Polymorphism
723
+ Polymorphism
731
724
  </h3>
732
725
  <p className="text-muted-foreground text-base leading-relaxed">
733
- Dùng pattern <code>asChild</code> hoặc <code>render</code> prop
734
- để thay đổi thẻ HTML root, không đẻ bừa các prop lồng nhau.
726
+ Dùng <code>render</code> prop để đổi thẻ HTML root —
727
+ dụ biến Button thành Link. Không cần prop <code>as</code>
728
+ {" "}hay tạo wrapper lồng nhau.
735
729
  </p>
736
730
  </div>
737
731
  <div className="relative z-10 mt-auto pt-6 space-y-3">
@@ -759,15 +753,14 @@ export default function OverviewSection() {
759
753
  </div>
760
754
  <div className="relative z-10 space-y-4">
761
755
  <h3 className="text-2xl font-extrabold tracking-tight">
762
- Dumb Primitives
756
+ Stateless Primitive
763
757
  </h3>
764
758
  <p className="text-muted-foreground text-base leading-relaxed">
765
- Micro component không được chứa{" "}
766
- <code>useState</code> hay <code>useEffect</code>. Chúng hoàn
767
- toàn stateless — mọi state đều thuộc về Headless UI hoặc Macro
768
- preset.{" "}
759
+ Micro component không chứa{" "}
760
+ <code>useState</code> hay <code>useEffect</code>. State nằm ở
761
+ Headless UI hoặc Macro.{" "}
769
762
  <strong className="text-foreground">
770
- Primitive càng "ngu" càng dễ test và dễ tin tưởng.
763
+ Component càng đơn giản, càng ít bug.
771
764
  </strong>
772
765
  </p>
773
766
  </div>
@@ -792,14 +785,13 @@ export default function OverviewSection() {
792
785
  </div>
793
786
  <div className="relative z-10 space-y-4">
794
787
  <h3 className="text-2xl font-extrabold tracking-tight">
795
- Accessibility First
788
+ Accessibility
796
789
  </h3>
797
790
  <p className="text-muted-foreground text-base leading-relaxed">
798
- Ưu tiên HTML semantic, liên kết form qua{" "}
799
- <code>aria-describedby</code>, ẩn icon trang trí bằng{" "}
800
- <code>aria-hidden</code> để đảm bảo WCAG AAA/AA.{" "}
791
+ Semantic HTML, <code>aria-describedby</code> cho form,
792
+ icon trang trí tự ẩn khỏi screen reader.{" "}
801
793
  <strong className="text-foreground">
802
- Accessibility thứ không ai để ý — cho đến khi bị audit.
794
+ Chuẩn WCAG không cần nghĩ thêm.
803
795
  </strong>
804
796
  </p>
805
797
  </div>
@@ -1106,15 +1098,14 @@ export default function OverviewSection() {
1106
1098
  <div className="absolute inset-0 bg-[radial-gradient(ellipse_60%_60%_at_50%_0%,rgba(var(--primary-rgb),0.15),transparent)] pointer-events-none" />
1107
1099
  <div className="relative z-10 space-y-6 max-w-2xl mx-auto">
1108
1100
  <h2 className="text-3xl md:text-5xl font-extrabold tracking-tight">
1109
- Sẵn sàng bắt đầu?
1101
+ Thử ngay?
1110
1102
  </h2>
1111
1103
  <p className="text-muted-foreground text-lg leading-relaxed">
1112
- Toàn bộ source code sẽ nằm trong thư mục{" "}
1104
+ 30 giây — toàn bộ code nằm trong{" "}
1113
1105
  <code className="text-sm bg-primary/20 text-primary px-1.5 py-0.5 rounded">
1114
1106
  src/
1115
1107
  </code>{" "}
1116
- của bạn trong vòng 30 giây. Không cần config. Không cần đọc thêm
1117
- tài liệu.
1108
+ của bạn. Không config, không đọc docs.
1118
1109
  </p>
1119
1110
  <div className="flex flex-col sm:flex-row items-center justify-center gap-4 pt-2">
1120
1111
  <button