@cosxai/ui 0.4.1 → 0.4.3
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 +1 -1
- package/src/primitives/Input.tsx +8 -0
- package/src/styles/index.css +24 -0
- package/src/styles/tokens.css +16 -10
package/package.json
CHANGED
package/src/primitives/Input.tsx
CHANGED
|
@@ -98,6 +98,14 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|
|
98
98
|
flexDirection: "column",
|
|
99
99
|
gap: 6,
|
|
100
100
|
width: fit === "full" ? "100%" : undefined,
|
|
101
|
+
// minWidth: 0 lets a parent flex container shrink this
|
|
102
|
+
// wrapper past the inner addon-wrap's nowrap suffix content.
|
|
103
|
+
// Without it, a long suffix (e.g. ".meta.test.cosx.dev")
|
|
104
|
+
// sets a min-content floor that pushes the form wider than
|
|
105
|
+
// its mobile viewport. Per-page CSS workarounds in consumer
|
|
106
|
+
// apps only cover their own scope; fixing it at the primitive
|
|
107
|
+
// catches every page.
|
|
108
|
+
minWidth: 0,
|
|
101
109
|
}}
|
|
102
110
|
>
|
|
103
111
|
{label && (
|
package/src/styles/index.css
CHANGED
|
@@ -117,6 +117,30 @@ html[data-ck-chrome="seamless"] .ck-card__foot {
|
|
|
117
117
|
color: var(--ck-text-tertiary);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
/* ---------- Input + Textarea disabled state ----------
|
|
121
|
+
Native :disabled styling is barely perceptible on a cream / dark
|
|
122
|
+
surface, which made disabled fields read as editable in
|
|
123
|
+
product-meta's settings (the email field in particular). Match
|
|
124
|
+
the .ck-btn:disabled treatment so consumers don't have to
|
|
125
|
+
reapply the same opacity / cursor pattern at every call site.
|
|
126
|
+
|
|
127
|
+
The addon-wrap variant uses :has(:disabled) so a wrapping
|
|
128
|
+
.ck-input-addon-wrap also dims when its inner <input> is disabled
|
|
129
|
+
— otherwise the slug input dims but its ".meta.test.cosx.dev"
|
|
130
|
+
suffix stays at full opacity, which looks broken. :has() is
|
|
131
|
+
supported across all evergreen browsers since 2023; pre-1.0 we
|
|
132
|
+
don't need a polyfill. */
|
|
133
|
+
.ck-input:disabled,
|
|
134
|
+
.ck-textarea:disabled,
|
|
135
|
+
.ck-input-addon-wrap:has(:disabled) {
|
|
136
|
+
opacity: 0.55;
|
|
137
|
+
cursor: not-allowed;
|
|
138
|
+
}
|
|
139
|
+
.ck-input:disabled,
|
|
140
|
+
.ck-textarea:disabled {
|
|
141
|
+
background: var(--ck-bg-muted, var(--ck-bg-surface));
|
|
142
|
+
}
|
|
143
|
+
|
|
120
144
|
/* ---------- Select (custom listbox — never native <select>) ----------
|
|
121
145
|
The trigger LOOKS like .ck-input so chrome restyles cascade
|
|
122
146
|
uniformly. Chromes that want a different vibe (terminal squared,
|
package/src/styles/tokens.css
CHANGED
|
@@ -195,12 +195,18 @@ html[data-ck-chrome="editorial"] {
|
|
|
195
195
|
--ck-text-disabled: #C9C3B5;
|
|
196
196
|
--ck-text-inverse: #ECE6D6;
|
|
197
197
|
|
|
198
|
-
/* Coral is THE accent. Ochre lives in --ck-warning for
|
|
198
|
+
/* Coral is THE editorial accent. Ochre lives in --ck-warning for
|
|
199
199
|
secondary "guest star" use (the brief says one accent only;
|
|
200
|
-
ochre repurposes the warning slot since its tone matches).
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
ochre repurposes the warning slot since its tone matches).
|
|
201
|
+
Runtime brand override flows through --ck-accent-light-override
|
|
202
|
+
just like the default :root chain — coral is the FALLBACK, not
|
|
203
|
+
a hardcode. hover/active derive via the same color-mix formula
|
|
204
|
+
so brand colour cascades to the full accent family. Muted /
|
|
205
|
+
border keep editorial's softer 14% / 40% (vs base 8% / 35%) so
|
|
206
|
+
the editorial "watercolour wash" feel survives a brand swap. */
|
|
207
|
+
--ck-accent: var(--ck-accent-light-override, #E96E50);
|
|
208
|
+
--ck-accent-hover: color-mix(in oklab, var(--ck-accent), black 10%);
|
|
209
|
+
--ck-accent-active: color-mix(in oklab, var(--ck-accent), black 18%);
|
|
204
210
|
--ck-accent-muted: color-mix(in oklab, var(--ck-accent) 14%, transparent);
|
|
205
211
|
--ck-accent-border: color-mix(in oklab, var(--ck-accent) 40%, transparent);
|
|
206
212
|
--ck-border-focus: var(--ck-accent);
|
|
@@ -734,7 +740,7 @@ html[data-ck-chrome="riso"] {
|
|
|
734
740
|
associates with the aesthetic. Override per-app for blue /
|
|
735
741
|
yellow / orange-led palettes. */
|
|
736
742
|
--ck-accent: var(--ck-accent-light-override, #FF48B0);
|
|
737
|
-
--ck-accent-hover:
|
|
743
|
+
--ck-accent-hover: color-mix(in oklab, var(--ck-accent), black 10%);
|
|
738
744
|
--ck-accent-muted: color-mix(in oklab, var(--ck-accent) 14%, transparent);
|
|
739
745
|
--ck-accent-border: color-mix(in oklab, var(--ck-accent) 50%, transparent);
|
|
740
746
|
|
|
@@ -798,7 +804,7 @@ html[data-ck-theme="dark"][data-ck-chrome="riso"] {
|
|
|
798
804
|
--ck-text-inverse: #14131A;
|
|
799
805
|
|
|
800
806
|
--ck-accent: var(--ck-accent-dark-override, var(--ck-accent-light-override, #FF6FBF));
|
|
801
|
-
--ck-accent-hover:
|
|
807
|
+
--ck-accent-hover: color-mix(in oklab, var(--ck-accent), white 10%);
|
|
802
808
|
|
|
803
809
|
--ck-shadow-1: 0 1px 0 rgba(0, 0, 0, 0.6);
|
|
804
810
|
--ck-shadow-2: 3px 3px 0 var(--ck-riso-blue);
|
|
@@ -846,9 +852,9 @@ html[data-ck-chrome="sketch"] {
|
|
|
846
852
|
--ck-sketch-hi-green: rgba(111, 207, 151, 0.32);
|
|
847
853
|
|
|
848
854
|
--ck-accent: var(--ck-accent-light-override, var(--ck-sketch-blue));
|
|
849
|
-
--ck-accent-hover:
|
|
850
|
-
--ck-accent-muted:
|
|
851
|
-
--ck-accent-border:
|
|
855
|
+
--ck-accent-hover: color-mix(in oklab, var(--ck-accent), black 10%);
|
|
856
|
+
--ck-accent-muted: color-mix(in oklab, var(--ck-accent) 16%, transparent);
|
|
857
|
+
--ck-accent-border: color-mix(in oklab, var(--ck-accent) 50%, transparent);
|
|
852
858
|
|
|
853
859
|
/* Handwriting fonts — Caveat / Patrick Hand / Kalam are common
|
|
854
860
|
Google Fonts; Comic Sans MS is the universal fallback that
|