@enablo/swirlcn-ui 0.0.0-stage → 0.5.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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -2
  3. package/dist/chunk-3DJWDNQL.js +77 -0
  4. package/dist/chunk-7XUCETA6.js +447 -0
  5. package/dist/chunk-KZESIYUN.js +18 -0
  6. package/dist/flip.d.ts +98 -0
  7. package/dist/flip.js +158 -0
  8. package/dist/fonts/Inter-italic.var.woff2 +0 -0
  9. package/dist/fonts/Inter.var.woff2 +0 -0
  10. package/dist/fonts/OFL.txt +96 -0
  11. package/dist/index.d.ts +2459 -0
  12. package/dist/index.js +8439 -0
  13. package/dist/server.d.ts +144 -0
  14. package/dist/server.js +88 -0
  15. package/dist/spacing-BQaEPbUv.d.ts +59 -0
  16. package/dist/theme.css +146 -0
  17. package/package.json +84 -3
  18. package/src/components/accordion.tsx +102 -0
  19. package/src/components/action-list.tsx +294 -0
  20. package/src/components/alert-dialog.tsx +155 -0
  21. package/src/components/autocomplete.tsx +313 -0
  22. package/src/components/avatar.tsx +258 -0
  23. package/src/components/badge.tsx +100 -0
  24. package/src/components/banner.tsx +112 -0
  25. package/src/components/button-group.tsx +87 -0
  26. package/src/components/button.tsx +362 -0
  27. package/src/components/card.tsx +186 -0
  28. package/src/components/carousel.tsx +245 -0
  29. package/src/components/checkbox.tsx +125 -0
  30. package/src/components/chip.tsx +153 -0
  31. package/src/components/color-input.tsx +98 -0
  32. package/src/components/data-cell.tsx +230 -0
  33. package/src/components/date-input.tsx +223 -0
  34. package/src/components/date-picker.tsx +276 -0
  35. package/src/components/description-list.tsx +97 -0
  36. package/src/components/dialog.tsx +405 -0
  37. package/src/components/empty-state.tsx +63 -0
  38. package/src/components/file-chip.tsx +206 -0
  39. package/src/components/file-uploader.tsx +148 -0
  40. package/src/components/flip-app-header.tsx +104 -0
  41. package/src/components/flip-brand.tsx +77 -0
  42. package/src/components/flip-theme.tsx +95 -0
  43. package/src/components/form-control.tsx +397 -0
  44. package/src/components/form-group.tsx +26 -0
  45. package/src/components/heading.tsx +70 -0
  46. package/src/components/icon.tsx +119 -0
  47. package/src/components/image-grid.tsx +285 -0
  48. package/src/components/inline-notification.tsx +167 -0
  49. package/src/components/inline-status.tsx +100 -0
  50. package/src/components/input.tsx +390 -0
  51. package/src/components/label.tsx +28 -0
  52. package/src/components/lightbox.tsx +314 -0
  53. package/src/components/link.tsx +46 -0
  54. package/src/components/list.tsx +40 -0
  55. package/src/components/menu.tsx +530 -0
  56. package/src/components/option-list.tsx +582 -0
  57. package/src/components/pagination.tsx +336 -0
  58. package/src/components/popover.tsx +194 -0
  59. package/src/components/progress.tsx +158 -0
  60. package/src/components/radio-group.tsx +136 -0
  61. package/src/components/resource-list.tsx +686 -0
  62. package/src/components/search.tsx +127 -0
  63. package/src/components/select.tsx +456 -0
  64. package/src/components/separator.tsx +93 -0
  65. package/src/components/skeleton-box.tsx +63 -0
  66. package/src/components/skeleton-text.tsx +66 -0
  67. package/src/components/spinner.tsx +83 -0
  68. package/src/components/stack.tsx +86 -0
  69. package/src/components/status-indicator.tsx +31 -0
  70. package/src/components/switch.tsx +90 -0
  71. package/src/components/table.tsx +242 -0
  72. package/src/components/tabs.tsx +147 -0
  73. package/src/components/tag.tsx +169 -0
  74. package/src/components/text.tsx +126 -0
  75. package/src/components/textarea.tsx +130 -0
  76. package/src/components/theme-provider.tsx +115 -0
  77. package/src/components/thumbnail.tsx +250 -0
  78. package/src/components/time-input.tsx +123 -0
  79. package/src/components/toast.tsx +217 -0
  80. package/src/components/toggle-group.tsx +124 -0
  81. package/src/components/toolbar.tsx +105 -0
  82. package/src/components/tooltip.tsx +97 -0
  83. package/src/components/tree-navigation.tsx +194 -0
  84. package/src/components/tree-view.tsx +292 -0
  85. package/src/flip.ts +12 -0
  86. package/src/index.ts +317 -0
  87. package/src/lib/date-mask.ts +176 -0
  88. package/src/lib/field-context.ts +86 -0
  89. package/src/lib/flip-app-script.ts +38 -0
  90. package/src/lib/flip-host.ts +84 -0
  91. package/src/lib/flip-theme-css.ts +90 -0
  92. package/src/lib/focus.ts +18 -0
  93. package/src/lib/glyphs.ts +137 -0
  94. package/src/lib/spacing.ts +93 -0
  95. package/src/lib/theme-context.ts +27 -0
  96. package/src/lib/theme-script.ts +49 -0
  97. package/src/lib/use-mobile.ts +17 -0
  98. package/src/lib/utils.ts +28 -0
  99. package/src/server.ts +20 -0
  100. package/src/styles/fonts/Inter-italic.var.woff2 +0 -0
  101. package/src/styles/fonts/Inter.var.woff2 +0 -0
  102. package/src/styles/fonts/OFL.txt +96 -0
  103. package/src/styles/theme.css +146 -0
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The one stylesheet a consuming app needs.
3
+ *
4
+ * @import "tailwindcss";
5
+ * @import "@enablo/swirlcn-ui/theme.css";
6
+ *
7
+ * Brings in the generated Swirl token layer, a small base layer, and - when
8
+ * consuming the prebuilt npm package - a @source rule so Tailwind sees the
9
+ * class names baked into the shipped components. Apps that copied components in
10
+ * via the registry are scanned by Tailwind automatically and can ignore it.
11
+ */
12
+
13
+ @import "@enablo/swirlcn-tokens/theme.css";
14
+ @import "tw-animate-css";
15
+
16
+ /* Inter, as Swirl ships it. The family name is the first entry in
17
+ --s-font-family-text, so the token stack picks these up unchanged. The
18
+ paths are relative to this file; Tailwind rebases them when it inlines the
19
+ import, and the app's bundler emits the files. See fonts/OFL.txt. */
20
+ @font-face {
21
+ font-family: "Inter var experimental";
22
+ font-style: normal;
23
+ font-weight: 100 900;
24
+ font-display: swap;
25
+ src: url("./fonts/Inter.var.woff2") format("woff2");
26
+ }
27
+
28
+ @font-face {
29
+ font-family: "Inter var experimental";
30
+ font-style: italic;
31
+ font-weight: 100 900;
32
+ font-display: swap;
33
+ src: url("./fonts/Inter-italic.var.woff2") format("woff2");
34
+ }
35
+
36
+ /* Scan the bundle for class names - every file, not just index.js: helpers
37
+ shared with the /server entry (spacing, focus) land in a separate chunk.
38
+ Harmless when it resolves to nothing, as when imported straight from src. */
39
+ @source "./*.js";
40
+
41
+ /* Swirl switches buttons and inputs to a denser desktop layout - smaller
42
+ padding, type and radius - under this exact condition. It is not a plain
43
+ min-width breakpoint: between 992px and 1439px it also requires a real
44
+ pointer, so large touch tablets keep touch sizing. Components use
45
+ `desktop:`. */
46
+ @custom-variant desktop {
47
+ @media (min-width: 62rem) and (max-width: 89.9375rem) and (hover: hover),
48
+ (min-width: 90rem) {
49
+ @slot;
50
+ }
51
+ }
52
+
53
+ /* Inside Flip's mobile app, which can't hide its own header: `<FlipAppScript>`
54
+ marks <html> with `flip-app` before the first paint. Write `flip-app:hidden`
55
+ to drop the app's own header there, or `hidden flip-app:inline-flex` to
56
+ show something only there. */
57
+ @custom-variant flip-app (&:where(.flip-app, .flip-app *));
58
+
59
+ @layer base {
60
+ *,
61
+ ::after,
62
+ ::before {
63
+ border-color: var(--color-border);
64
+ }
65
+
66
+ html {
67
+ -webkit-text-size-adjust: 100%;
68
+ }
69
+
70
+ body {
71
+ background-color: var(--color-background);
72
+ color: var(--color-foreground);
73
+ font-family: var(--font-sans);
74
+ font-size: var(--text-base);
75
+ line-height: var(--s-line-height-base);
76
+ -webkit-font-smoothing: antialiased;
77
+ }
78
+
79
+ /* Swirl relies on a variable Inter; fall back cleanly when it is absent. */
80
+ @supports (font-variation-settings: normal) {
81
+ body {
82
+ font-optical-sizing: auto;
83
+ }
84
+ }
85
+
86
+ ::selection {
87
+ background-color: var(--color-highlight-surface);
88
+ color: var(--color-on-highlight);
89
+ }
90
+ }
91
+
92
+ @utility scrollbar-swirl {
93
+ scrollbar-width: thin;
94
+ scrollbar-color: var(--color-border-strong) transparent;
95
+ }
96
+
97
+ /* The indeterminate Progress sweep and Swirl's skeleton and spinner motion. tw-animate-css covers the rest. */
98
+ @theme {
99
+ --animate-spinner-rotate: spinner-rotate 2s linear infinite;
100
+ --animate-spinner-dash: spinner-dash 1.5s ease-in-out infinite;
101
+
102
+ @keyframes spinner-rotate {
103
+ 100% {
104
+ transform: rotate(360deg);
105
+ }
106
+ }
107
+
108
+ @keyframes spinner-dash {
109
+ 0% {
110
+ stroke-dasharray: 1, 200;
111
+ stroke-dashoffset: 0;
112
+ }
113
+ 50% {
114
+ stroke-dasharray: 89, 200;
115
+ stroke-dashoffset: -35;
116
+ }
117
+ 100% {
118
+ stroke-dasharray: 89, 200;
119
+ stroke-dashoffset: -124;
120
+ }
121
+ }
122
+
123
+ --animate-progress-indeterminate: progress-indeterminate 1.4s ease-in-out infinite;
124
+ --animate-skeleton-shimmer: skeleton-shimmer 3s infinite;
125
+
126
+ @keyframes skeleton-shimmer {
127
+ 0% {
128
+ transform: translateX(-100%);
129
+ }
130
+ 100% {
131
+ transform: translateX(100%);
132
+ }
133
+ }
134
+
135
+ @keyframes progress-indeterminate {
136
+ 0% {
137
+ transform: translateX(-100%) scaleX(0.4);
138
+ }
139
+ 50% {
140
+ transform: translateX(10%) scaleX(0.6);
141
+ }
142
+ 100% {
143
+ transform: translateX(100%) scaleX(0.4);
144
+ }
145
+ }
146
+ }