@chotot/clad-ui 3.0.1 → 3.1.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.
@@ -1 +1 @@
1
- "use client";require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`react`),t=require(`react/jsx-runtime`),n=require(`react-dom`),r=require(`@floating-ui/react-dom`);var i={...r.platform,getDimensions(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height}}},a=typeof window<`u`?e.useLayoutEffect:e.useEffect;function o(...e){return t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)}}function s(e){switch(e){case`top-center`:return`top`;case`bottom-center`:return`bottom`;case`left-center`:return`left`;case`right-center`:return`right`;case`center`:return`top`;default:return e}}function c(e,t){if(t||e===`center`)return`center`;let n=e.split(`-`)[0];return n===`top`||n===`bottom`||n===`left`||n===`right`?n:`top`}var l=`layers`;function u(){if(typeof document>`u`)return null;let e=document.getElementById(l);return e||(e=document.createElement(`div`),e.id=l,e.style.cssText=`position: absolute; top: 0px; left: 0px; right: 0px;`,document.body.appendChild(e)),e}function d(e,t,n){return e<t?t:e>n?n:e}function f(t){let{isOpen:o=!1,placement:l=`top-center`,possiblePlacements:f,auto:p=!1,snap:m=!1,triggerOffset:h=0,arrowOffset:g=0,containerOffset:_=10,overflowContainer:v=!0,onOutsideClick:y}=t,b=l===`center`,x=(0,e.useRef)(null),S=(0,e.useRef)(null),C=(0,e.useRef)(null),[w,T]=(0,e.useState)(null),E=v?`fixed`:`absolute`,{x:D,y:O,refs:k,placement:A,middlewareData:j,update:M}=(0,r.useFloating)({open:o,placement:s(l),strategy:E,platform:i,middleware:(0,e.useMemo)(()=>{if(b)return[{name:`center`,fn({rects:e}){return{x:e.reference.x+e.reference.width/2-e.floating.width/2,y:e.reference.y+e.reference.height/2-e.floating.height/2}}}];let e=[(0,r.offset)(h)];if(p){let t=f?f.filter(e=>e!==l&&e!==`center`).map(s):void 0;e.push((0,r.flip)({padding:_,crossAxis:m?`alignment`:!1,...t?{fallbackPlacements:t}:{}})),m||e.push((0,r.shift)({padding:_}))}return w&&e.push({name:`reactLaagArrowClamp`,fn({x:e,y:t,rects:n,placement:r}){let i=r.split(`-`)[0],a=i===`left`||i===`right`,o=g*2,s=a?n.reference.y:n.reference.x,c=a?n.reference.height:n.reference.width,l=a?n.floating.height:n.floating.width,u=s-(l-16)+o,f=s+(c-16)-o,p=a?e:d(e,u,f),m=a?d(t,u,f):t,h=a?m:p,_=h+l,v=s+c,y=c>l,b=g+16/2,x=l-16/2-g,S=h+l/2-s-16/2-g,C=_-l/2-v+16/2+g,w=(S<0?-S:0)+(C>0?C:0);return{x:p,y:m,data:{arrowPos:d(y?l/2+w:s+c/2-h,b,x)}}}},(0,r.arrow)({element:w,padding:g})),e},[b,h,p,f,l,_,m,w,g]),whileElementsMounted:r.autoUpdate}),N=(0,e.useCallback)(e=>{e&&e!==x.current&&(x.current=e)},[]),P=(0,e.useCallback)(e=>{S.current=e,x.current&&k.reference.current!==x.current&&k.setReference(x.current),k.setFloating(e)},[k]),F=(0,e.useCallback)(e=>{C.current=e,T(t=>t===e?t:e)},[]);a(()=>{o&&x.current&&(k.reference.current!==x.current&&k.setReference(x.current),M())},[o,k,M]);let I=(0,e.useRef)(y);I.current=y,(0,e.useEffect)(()=>{if(!o||!I.current)return;let e=e=>{let t=e.target;if(!t)return;let n=x.current&&x.current.contains(t),r=S.current&&S.current.contains(t);!n&&!r&&I.current?.()};return document.addEventListener(`click`,e,!0),()=>{document.removeEventListener(`click`,e,!0)}},[o]);let L=c(A,b),R=L===`left`||L===`right`,z=(0,e.useMemo)(()=>{let e={position:`absolute`,willChange:`top, left`};if(L===`center`)return e;let t=j.reactLaagArrowClamp,n=j.arrow?.x,r=j.arrow?.y,i=R?r==null?0:r+8:n==null?0:n+8,a=t?.arrowPos??i;return{...e,[L]:`100%`,...R?{top:a}:{left:a}}},[L,R,j.reactLaagArrowClamp,j.arrow?.x,j.arrow?.y]),B=(0,e.useMemo)(()=>({willChange:`top, left, width, height`,position:E,top:O??0,left:D??0}),[E,D,O]),V=(0,e.useCallback)(e=>{let t=u();return t?(0,n.createPortal)(e,t):null},[]);return{triggerProps:{ref:N},layerProps:{ref:P,style:B},arrowProps:{ref:F,style:z,layerSide:L},layerSide:L,get triggerBounds(){return o&&x.current?x.current.getBoundingClientRect():null},renderLayer:V}}function p(e,t){return Math.tan(Math.PI/180*e)*t}function m(e,t,n,r){return{bottom:`0 ${-r} ${t} ${e}`,top:`0 0 ${t} ${e+r}`,right:`${-r} 0 ${e} ${t}`,left:`0 0 ${e+r} ${t}`}[n]}function h(e,t,n,r,i){let a=n===`left`||n===`right`,o=r/10*e*2,s={bottom:[0,e],top:[0,0],right:[e,t],left:[0,t]}[n].join(` `),c=a?`V 0`:`H ${t}`,l=t/2,u=t/2+p(i,e/8),d=e/8,f={bottom:[`C`,u,d,l+o,0,l,0],top:[`C`,u,e-d,l+o,e,l,e],right:[`C`,d,t-u,0,l-o,0,l],left:[`C`,e-d,t-u,e,l-o,e,l]}[n].join(` `),m=t/2-p(i,e/8),h=e/8;return[`M`,s,c,f,{bottom:[`C`,l-o,0,m,h,s],top:[`C`,l-o,e,m,e-h,s],right:[`C`,0,l+o,h,t-m,s],left:[`C`,e,l+o,e-h,t-m,s]}[n].join(` `)].join(` `)}function g(e,t,n,r,i){let a=r===`left`||r===`right`,o=r===`top`||r===`left`,s=p(i,n),[c,l]=o?[0,n]:[e,e-n];return a?[`M`,c,n,`V`,t-n,`L`,l,t-n-s,`V`,s+n,`Z`].join(` `):[`M`,n,c,`H`,t-n,`L`,t-n-s,l,`H`,s+n,`Z`].join(` `)}var _=(0,e.forwardRef)(function({size:e=8,angle:n=45,borderWidth:r=0,borderColor:i=`black`,roundness:a=0,backgroundColor:o=`white`,layerSide:s=`top`,style:c={},...l},u){if(s===`center`)return null;let d=s===`left`||s===`right`,f=s===`top`||s===`left`,_=e,v=p(n,e)*2,y=Math.max(_,v);return(0,t.jsxs)(`svg`,{ref:u,...l,style:{...c,transform:`translate${d?`Y`:`X`}(-50%)`},width:y,height:y,preserveAspectRatio:f?`xMinYMin`:`xMaxYMax`,viewBox:m(_,v,s,r),children:[(0,t.jsx)(`path`,{fill:o,strokeWidth:r,stroke:i,d:h(_,v,s,a,n)}),(0,t.jsx)(`path`,{fill:o,d:g(_,v,r,s,n)})]})}),v={ENTERING:0,LEAVING:1,IDLE:2};function y(t={}){let{delayEnter:n=0,delayLeave:r=0,hideOnScroll:i=!0}=t,[a,o]=(0,e.useState)(!1),s=(0,e.useRef)(null),c=(0,e.useRef)(v.IDLE),l=(0,e.useRef)(!1),u=(0,e.useCallback)(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),c.current=v.IDLE},[]),d=()=>{c.current===v.LEAVING&&s.current!==null&&u(),!a&&(c.current=v.ENTERING,s.current=window.setTimeout(()=>{o(!0),s.current=null,c.current=v.IDLE},n))},f=e=>{if(c.current===v.ENTERING&&s.current!==null&&u(),a){if(e){o(!1),s.current=null,c.current=v.IDLE;return}c.current=v.LEAVING,s.current=window.setTimeout(()=>{o(!1),s.current=null,c.current=v.IDLE},r)}};return(0,e.useEffect)(()=>{let e=()=>{a&&i&&(u(),o(!1))};return window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`scroll`,e,!0),s.current!==null&&window.clearTimeout(s.current)}},[a,i,u]),[a,{onMouseEnter:d,onMouseLeave:()=>f(!1),onTouchStart:()=>{l.current=!1},onTouchMove:()=>{l.current=!0},onTouchEnd:()=>{!l.current&&!a&&o(!0),l.current=!1}},()=>f(!0)]}exports.Arrow=_,exports.mergeRefs=o,exports.useHover=y,exports.useLayer=f;
1
+ "use client";require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`react`),t=require(`react/jsx-runtime`),n=require(`react-dom`),r=require(`@floating-ui/react-dom`);var i={...r.platform,getDimensions(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height}}},a=typeof window<`u`?e.useLayoutEffect:e.useEffect;function o(...e){return t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)}}function s(e){switch(e){case`top-center`:return`top`;case`bottom-center`:return`bottom`;case`left-center`:return`left`;case`right-center`:return`right`;case`center`:return`top`;default:return e}}function c(e,t){if(t||e===`center`)return`center`;let n=e.split(`-`)[0];return n===`top`||n===`bottom`||n===`left`||n===`right`?n:`top`}var l=`layers`;function u(){if(typeof document>`u`)return null;let e=document.getElementById(l);return e||(e=document.createElement(`div`),e.id=l,e.style.cssText=`position: absolute; top: 0px; left: 0px; right: 0px;`,document.body.appendChild(e)),e}function d(e,t,n){return e<t?t:e>n?n:e}function f(t){let{isOpen:o=!1,placement:l=`top-center`,possiblePlacements:f,auto:p=!1,snap:m=!1,triggerOffset:h=0,arrowOffset:g=0,containerOffset:_=10,overflowContainer:v=!0,onOutsideClick:y}=t,b=l===`center`,x=(0,e.useRef)(null),S=(0,e.useRef)(null),C=(0,e.useRef)(null),[w,T]=(0,e.useState)(null),E=v?`fixed`:`absolute`,{x:D,y:O,refs:k,placement:A,middlewareData:j,update:M}=(0,r.useFloating)({open:o,placement:s(l),strategy:E,platform:i,middleware:(0,e.useMemo)(()=>{let e={name:`triggerSize`,fn({rects:e}){return{data:{width:e.reference.width,height:e.reference.height}}}};if(b)return[e,{name:`center`,fn({rects:e}){return{x:e.reference.x+e.reference.width/2-e.floating.width/2,y:e.reference.y+e.reference.height/2-e.floating.height/2}}}];let t=[e,(0,r.offset)(h)];if(p){let e=f?f.filter(e=>e!==l&&e!==`center`).map(s):void 0;t.push((0,r.flip)({padding:_,crossAxis:m?`alignment`:!1,...e?{fallbackPlacements:e}:{}})),m||t.push((0,r.shift)({padding:_}))}return w&&t.push({name:`reactLaagArrowClamp`,fn({x:e,y:t,rects:n,placement:r}){let i=r.split(`-`)[0],a=i===`left`||i===`right`,o=g*2,s=a?n.reference.y:n.reference.x,c=a?n.reference.height:n.reference.width,l=a?n.floating.height:n.floating.width,u=s-(l-16)+o,f=s+(c-16)-o,p=a?e:d(e,u,f),m=a?d(t,u,f):t,h=a?m:p,_=h+l,v=s+c,y=c>l,b=g+16/2,x=l-16/2-g,S=h+l/2-s-16/2-g,C=_-l/2-v+16/2+g,w=(S<0?-S:0)+(C>0?C:0);return{x:p,y:m,data:{arrowPos:d(y?l/2+w:s+c/2-h,b,x)}}}},(0,r.arrow)({element:w,padding:g})),t},[b,h,p,f,l,_,m,w,g]),whileElementsMounted:r.autoUpdate}),N=(0,e.useCallback)(e=>{e&&e!==x.current&&(x.current=e)},[]),P=(0,e.useCallback)(e=>{S.current=e,x.current&&k.reference.current!==x.current&&k.setReference(x.current),k.setFloating(e)},[k]),F=(0,e.useCallback)(e=>{C.current=e,T(t=>t===e?t:e)},[]);a(()=>{o&&x.current&&(k.reference.current!==x.current&&k.setReference(x.current),M())},[o,k,M]);let I=(0,e.useRef)(y);I.current=y,(0,e.useEffect)(()=>{if(!o||!I.current)return;let e=e=>{let t=e.target;if(!t)return;let n=x.current&&x.current.contains(t),r=S.current&&S.current.contains(t);!n&&!r&&I.current?.()};return document.addEventListener(`click`,e,!0),()=>{document.removeEventListener(`click`,e,!0)}},[o]);let L=c(A,b),R=L===`left`||L===`right`,z=(0,e.useMemo)(()=>{let e={position:`absolute`,willChange:`top, left`};if(L===`center`)return e;let t=j.reactLaagArrowClamp,n=j.arrow?.x,r=j.arrow?.y,i=R?r==null?0:r+8:n==null?0:n+8,a=t?.arrowPos??i;return{...e,[L]:`100%`,...R?{top:a}:{left:a}}},[L,R,j.reactLaagArrowClamp,j.arrow?.x,j.arrow?.y]),B=(0,e.useMemo)(()=>({willChange:`top, left, width, height`,position:E,top:O??0,left:D??0}),[E,D,O]),V=(0,e.useCallback)(e=>{let t=u();return t?(0,n.createPortal)(e,t):null},[]);return{triggerProps:{ref:N},layerProps:{ref:P,style:B},arrowProps:{ref:F,style:z,layerSide:L},layerSide:L,get triggerBounds(){return o&&x.current?x.current.getBoundingClientRect():null},renderLayer:V}}function p(e,t){return Math.tan(Math.PI/180*e)*t}function m(e,t,n,r){return{bottom:`0 ${-r} ${t} ${e}`,top:`0 0 ${t} ${e+r}`,right:`${-r} 0 ${e} ${t}`,left:`0 0 ${e+r} ${t}`}[n]}function h(e,t,n,r,i){let a=n===`left`||n===`right`,o=r/10*e*2,s={bottom:[0,e],top:[0,0],right:[e,t],left:[0,t]}[n].join(` `),c=a?`V 0`:`H ${t}`,l=t/2,u=t/2+p(i,e/8),d=e/8,f={bottom:[`C`,u,d,l+o,0,l,0],top:[`C`,u,e-d,l+o,e,l,e],right:[`C`,d,t-u,0,l-o,0,l],left:[`C`,e-d,t-u,e,l-o,e,l]}[n].join(` `),m=t/2-p(i,e/8),h=e/8;return[`M`,s,c,f,{bottom:[`C`,l-o,0,m,h,s],top:[`C`,l-o,e,m,e-h,s],right:[`C`,0,l+o,h,t-m,s],left:[`C`,e,l+o,e-h,t-m,s]}[n].join(` `)].join(` `)}function g(e,t,n,r,i){let a=r===`left`||r===`right`,o=r===`top`||r===`left`,s=p(i,n),[c,l]=o?[0,n]:[e,e-n];return a?[`M`,c,n,`V`,t-n,`L`,l,t-n-s,`V`,s+n,`Z`].join(` `):[`M`,n,c,`H`,t-n,`L`,t-n-s,l,`H`,s+n,`Z`].join(` `)}var _=(0,e.forwardRef)(function({size:e=8,angle:n=45,borderWidth:r=0,borderColor:i=`black`,roundness:a=0,backgroundColor:o=`white`,layerSide:s=`top`,style:c={},...l},u){if(s===`center`)return null;let d=s===`left`||s===`right`,f=s===`top`||s===`left`,_=e,v=p(n,e)*2,y=Math.max(_,v);return(0,t.jsxs)(`svg`,{ref:u,...l,style:{...c,transform:`translate${d?`Y`:`X`}(-50%)`},width:y,height:y,preserveAspectRatio:f?`xMinYMin`:`xMaxYMax`,viewBox:m(_,v,s,r),children:[(0,t.jsx)(`path`,{fill:o,strokeWidth:r,stroke:i,d:h(_,v,s,a,n)}),(0,t.jsx)(`path`,{fill:o,d:g(_,v,r,s,n)})]})}),v={ENTERING:0,LEAVING:1,IDLE:2};function y(t={}){let{delayEnter:n=0,delayLeave:r=0,hideOnScroll:i=!0}=t,[a,o]=(0,e.useState)(!1),s=(0,e.useRef)(null),c=(0,e.useRef)(v.IDLE),l=(0,e.useRef)(!1),u=(0,e.useCallback)(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),c.current=v.IDLE},[]),d=()=>{c.current===v.LEAVING&&s.current!==null&&u(),!a&&(c.current=v.ENTERING,s.current=window.setTimeout(()=>{o(!0),s.current=null,c.current=v.IDLE},n))},f=e=>{if(c.current===v.ENTERING&&s.current!==null&&u(),a){if(e){o(!1),s.current=null,c.current=v.IDLE;return}c.current=v.LEAVING,s.current=window.setTimeout(()=>{o(!1),s.current=null,c.current=v.IDLE},r)}};return(0,e.useEffect)(()=>{let e=()=>{a&&i&&(u(),o(!1))};return window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`scroll`,e,!0),s.current!==null&&window.clearTimeout(s.current)}},[a,i,u]),[a,{onMouseEnter:d,onMouseLeave:()=>f(!1),onTouchStart:()=>{l.current=!1},onTouchMove:()=>{l.current=!0},onTouchEnd:()=>{!l.current&&!a&&o(!0),l.current=!1}},()=>f(!0)]}exports.Arrow=_,exports.mergeRefs=o,exports.useHover=y,exports.useLayer=f;
@@ -50,7 +50,16 @@ function T(e) {
50
50
  strategy: F,
51
51
  platform: _,
52
52
  middleware: i(() => {
53
- if (k) return [{
53
+ let e = {
54
+ name: "triggerSize",
55
+ fn({ rects: e }) {
56
+ return { data: {
57
+ width: e.reference.width,
58
+ height: e.reference.height
59
+ } };
60
+ }
61
+ };
62
+ if (k) return [e, {
54
63
  name: "center",
55
64
  fn({ rects: e }) {
56
65
  return {
@@ -59,16 +68,16 @@ function T(e) {
59
68
  };
60
69
  }
61
70
  }];
62
- let e = [p(S)];
71
+ let t = [e, p(S)];
63
72
  if (m) {
64
- let t = c ? c.filter((e) => e !== s && e !== "center").map(b) : void 0;
65
- e.push(f({
73
+ let e = c ? c.filter((e) => e !== s && e !== "center").map(b) : void 0;
74
+ t.push(f({
66
75
  padding: E,
67
76
  crossAxis: y ? "alignment" : !1,
68
- ...t ? { fallbackPlacements: t } : {}
69
- })), y || e.push(h({ padding: E }));
77
+ ...e ? { fallbackPlacements: e } : {}
78
+ })), y || t.push(h({ padding: E }));
70
79
  }
71
- return N && e.push({
80
+ return N && t.push({
72
81
  name: "reactLaagArrowClamp",
73
82
  fn({ x: e, y: t, rects: n, placement: r }) {
74
83
  let i = r.split("-")[0], a = i === "left" || i === "right", o = T * 2, s = a ? n.reference.y : n.reference.x, c = a ? n.reference.height : n.reference.width, l = a ? n.floating.height : n.floating.width, u = s - (l - 16) + o, d = s + (c - 16) - o, f = a ? e : w(e, u, d), p = a ? w(t, u, d) : t, m = a ? p : f, h = m + l, g = s + c, _ = c > l, v = T + 16 / 2, y = l - 16 / 2 - T, b = m + l / 2 - s - 16 / 2 - T, x = h - l / 2 - g + 16 / 2 + T, S = (b < 0 ? -b : 0) + (x > 0 ? x : 0);
@@ -81,7 +90,7 @@ function T(e) {
81
90
  }, u({
82
91
  element: N,
83
92
  padding: T
84
- })), e;
93
+ })), t;
85
94
  }, [
86
95
  k,
87
96
  S,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chotot/clad-ui",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "Classified Ads group (Chotot) design system built on Tailwind CSS v4.",
5
5
  "keywords": [
6
6
  "chotot",
@@ -5,7 +5,7 @@ metadata:
5
5
  purpose: Build and style React UI using @chotot/clad-ui (Clad UI v3, Tailwind CSS v4) and @chotot/icons. Use when creating or updating UI components, selecting semantic color/typography tokens, wiring forms, modals, drawers, or tabs. Not for migrating legacy @chotot/clad-ui v2 Linaria code, use migrate-clad-ui-v3 instead.
6
6
  type: core
7
7
  library: '@chotot/clad-ui'
8
- library_version: '3.0.1'
8
+ library_version: '3.1.1'
9
9
  sources:
10
10
  - 'carousell/clad-ui:packages/clad-ui/src/**'
11
11
  ---
@@ -48,6 +48,19 @@ Discovery reads (fallback when an edge-case prop or icon name is not in `referen
48
48
  | Inline banner alert with icon and action | `Announcer` |
49
49
  | Raw `<h1>`–`<p>` with manual font sizes/weights | Typography components (`HeaderPage`, `LabelSection`, `BodySection`...) or `text-{header,label,body}-*` |
50
50
 
51
+ ## Typography Hierarchy (24 Components & Utilities)
52
+
53
+ Always compose text using this 6-tier semantic hierarchy instead of raw `text-sm` / `font-bold`:
54
+
55
+ | Tier (Weight / Style) | Components (`@chotot/clad-ui`) | Tailwind Utilities | Typical Role |
56
+ |---|---|---|---|
57
+ | **1. Display** (Bold) | `DisplayPage`, `DisplaySection`, `DisplayCaption`, `DisplayAnnotation`, `DisplayPrice` | `text-display-{page,section,caption,annotation,price}` | Hero headlines, KPI numbers, highlighted listing price (`DisplayPrice`) |
58
+ | **2. Header** (SemiBold) | `HeaderPage`, `HeaderSection`, `HeaderCaption`, `HeaderAnnotation` | `text-header-{page,section,caption,annotation}` | Page (`h1`), modal/drawer, and section (`h2`–`h3`) headings |
59
+ | **3. Label** (Bold) | `LabelPage`, `LabelSection`, `LabelCaption`, `LabelAnnotation` | `text-label-{page,section,caption,annotation}` | Card titles, field/button labels, emphasized inline values |
60
+ | **4. Body** (Regular) | `BodyPage`, `BodySection`, `BodyCaption`, `BodyAnnotation` | `text-body-{page,section,caption,annotation}` | Primary copy, descriptions, list/form content |
61
+ | **5. Note** (Italic) | `NotePage`, `NoteSection`, `NoteCaption` | `text-note-{page,section,caption}` | Secondary hints, disclaimers, timestamps |
62
+ | **6. Tagline** (Medium) | `TaglineSection`, `TaglineCaption`, `TaglineAnnotation`, `TaglineFootext` | `text-tagline-{section,caption,annotation,footext}` | Chips, badges, metadata pills, compact footers |
63
+
51
64
  ---
52
65
 
53
66
  ## Critical API & Event Gotchas
@@ -80,7 +93,7 @@ Discovery reads (fallback when an edge-case prop or icon name is not in `referen
80
93
  |---|---|
81
94
  | **Tokens** | Bg: `bg-background-{primary,secondary,tertiary,app,brand,brand-light,brand-light-secondary,chotot,info,success,error,warning}` · Text: `text-text-{primary,secondary,tertiary,disabled,blank,brand,on-background,info,success,error,warning}` · Border: `border-border-{divider,thin,regular,bold,active,brand,error,warning}` · Icon: `text-icon-{primary,secondary,tertiary,brand,error,success,warning}` · Typo: `text-{display,header,label,body}-{page,section,caption,annotation}`, `text-tagline-{section,caption,annotation,footext}` · Radius: `rounded-{ad-small,ad,card-small,card,decoration,modal,pill}` · Shadow: `shadow-{below,floating}` |
82
95
  | **Buttons** | `<Button color="primary\|info\|success\|error\|neutral\|tertiary" variant="solid\|outline\|tonal" size="sm\|md\|lg\|xl" icon isLoading as="a">` (also accepts `'small\|medium\|large\|xlarge'`) · Aliases: `IconButton`, `GhostButton`, `ButtonLink` |
83
- | **Chips & Tags** | `<Chip variant="fill\|outline\|ghost" size="sm\|md\|lg" active dropdownIcon icon={…} onClose={(val, e) => …} />` · `<TagCloud options={[{value,label}]} value={v} variant="fill\|outline" multiple maxSelection={n} onChange={e => setV(e.target.value)} />` |
96
+ | **Chips & Tags** | `<Chip variant="fill\|outline\|ghost" size="sm\|md\|lg\|xl" active dropdownIcon icon={…} onClose={(val, e) => …} />` · `<TagCloud options={[{value,label}]} value={v} variant="fill\|outline" size="sm\|md\|lg\|xl" multiple maxSelection={n} onChange={e => setV(e.target.value)} />` |
84
97
  | **Badges & Labels** | `<Badge size="sm\|md\|lg\|dot" label="9+" backgroundColor="error\|warning\|info\|success\|neutral" variant="solid\|tonal" borderRadius="pill">{child}</Badge>` · `<TextLabel color="info\|success\|error\|warning\|neutral" type="text\|status" size="md\|sm" label="…" />` · `<ShapeIcon size="xxxs..xxl" radius="circle\|md" bg="brand-light" color="brand"><Icon /></ShapeIcon>` |
85
98
  | **Text Inputs** | `<Input label="…" value={v} onChange={e => setV(e.target.value)} status="default\|warning\|error\|success" helptext="…" allowClear showPassword icon={…} />` · `<TextArea label="…" lines={4} value={v} status="default\|warning\|error" onChange={…} characterLimit={300} />` · `<CurrencyInput label="…" value={v} suffix=" đ" status="default\|warning\|error" onChange={e => setV(e.target.value)} onFormatChange={setFormatted} />` |
86
99
  | **Input Groups** | `<InputGroup status="default\|error" helptext="…"><Dropdown … /><Input … /></InputGroup>` · `<RangeInput helptext="…"><Input label="Từ" … /><Input label="Đến" … /></RangeInput>` |
@@ -105,6 +105,7 @@ import { TagCloud } from '@chotot/clad-ui';
105
105
  | `maxSelection` | `number` | — |
106
106
  | `label` / `helptext` | `string` | — |
107
107
  | `variant` | `'fill' \| 'outline'` (also accepts `'normal'`) | `'fill'` |
108
+ | `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` |
108
109
  | `selectedTextStyle` | `'bold' \| 'normal'` | `'bold'` |
109
110
 
110
111
  ---
@@ -5,7 +5,7 @@ metadata:
5
5
  purpose: Report bugs, request component/token/icon enhancements, or propose new ideas for @chotot/clad-ui, @chotot/icons, and @chotot/charts by creating structured GitHub issues in carousell/clad-ui. Use when a consumer developer hits a design system bug, missing prop/icon/token, migration blocker, or asks to file feedback/issue for Clad UI.
6
6
  type: sub-skill
7
7
  library: '@chotot/clad-ui'
8
- library_version: '3.0.1'
8
+ library_version: '3.1.1'
9
9
  requires:
10
10
  - clad-ui
11
11
  sources:
@@ -5,7 +5,7 @@ metadata:
5
5
  purpose: Migrate consumer React/Next.js code from @chotot/clad-ui v2 (Linaria) to @chotot/clad-ui v3 (Tailwind CSS v4) and @chotot/icons. Supports incremental file/feature migration (coexistence via @chotot/clad-ui-v2 alias) and full-repo cutover. Not for building new v3 UI from scratch, use clad-ui instead.
6
6
  type: lifecycle
7
7
  library: '@chotot/clad-ui'
8
- library_version: '3.0.1'
8
+ library_version: '3.1.1'
9
9
  requires:
10
10
  - clad-ui
11
11
  sources:
@@ -261,6 +261,7 @@ textarea {
261
261
  font-family: inherit;
262
262
  font-size: inherit;
263
263
  line-height: inherit;
264
+ color: inherit;
264
265
  }
265
266
 
266
267
  button,
@@ -184,9 +184,15 @@
184
184
  color: var(--solid-fg);
185
185
  border-color: var(--solid-border, var(--solid-bg));
186
186
 
187
+ &:visited,
188
+ &:hover {
189
+ color: var(--solid-fg);
190
+ }
191
+
187
192
  @media (hover: hover) {
188
193
  &:hover {
189
194
  background-color: var(--solid-hover);
195
+ color: var(--solid-fg);
190
196
  border-color: var(
191
197
  --solid-hover-border,
192
198
  var(--solid-border, var(--solid-hover))
@@ -196,6 +202,7 @@
196
202
 
197
203
  &:active {
198
204
  background-color: var(--solid-active);
205
+ color: var(--solid-fg);
199
206
  border-color: var(
200
207
  --solid-active-border,
201
208
  var(--solid-border, var(--solid-active))
@@ -215,9 +222,15 @@
215
222
  color: var(--text);
216
223
  border-color: var(--outline-border, currentColor);
217
224
 
225
+ &:visited,
226
+ &:hover {
227
+ color: var(--text);
228
+ }
229
+
218
230
  @media (hover: hover) {
219
231
  &:hover {
220
232
  background-color: var(--light-hover);
233
+ color: var(--text);
221
234
  border-color: var(
222
235
  --outline-hover-border,
223
236
  var(--outline-border, currentColor)
@@ -227,6 +240,7 @@
227
240
 
228
241
  &:active {
229
242
  background-color: var(--light-active);
243
+ color: var(--text);
230
244
  border-color: var(
231
245
  --outline-active-border,
232
246
  var(--outline-border, currentColor)
@@ -246,9 +260,15 @@
246
260
  color: var(--text);
247
261
  border-color: var(--tonal-border, var(--tonal-bg));
248
262
 
263
+ &:visited,
264
+ &:hover {
265
+ color: var(--text);
266
+ }
267
+
249
268
  @media (hover: hover) {
250
269
  &:hover {
251
270
  background-color: var(--light-hover);
271
+ color: var(--text);
252
272
  border-color: var(
253
273
  --tonal-hover-border,
254
274
  var(--tonal-border, var(--tonal-bg))
@@ -258,6 +278,7 @@
258
278
 
259
279
  &:active {
260
280
  background-color: var(--light-active);
281
+ color: var(--text);
261
282
  border-color: var(
262
283
  --tonal-active-border,
263
284
  var(--tonal-border, var(--tonal-bg))
@@ -301,6 +322,10 @@
301
322
  border-color: var(--default-border, transparent);
302
323
  color: var(--default-fg, var(--solid-bg));
303
324
 
325
+ &:visited {
326
+ color: var(--default-fg, var(--solid-bg));
327
+ }
328
+
304
329
  @media (hover: hover) {
305
330
  &:hover {
306
331
  background-color: var(--default-hover-bg, transparent);
@@ -4,6 +4,12 @@
4
4
  @apply relative inline-flex w-fit cursor-pointer items-center justify-center gap-1 rounded-full align-middle;
5
5
  background-color: var(--color-background-secondary);
6
6
  color: var(--color-text-primary);
7
+
8
+ &:visited,
9
+ &:active,
10
+ &:hover {
11
+ color: var(--color-text-primary);
12
+ }
7
13
  }
8
14
 
9
15
  /* ========== Sizes ========== */
@@ -60,6 +66,11 @@
60
66
  background-color: var(--color-background-inverted);
61
67
  color: var(--color-text-blank);
62
68
 
69
+ &:visited,
70
+ &:active {
71
+ color: var(--color-text-blank);
72
+ }
73
+
63
74
  @media (hover: hover) {
64
75
  &:not(.chip--disabled):hover {
65
76
  background-color: var(--color-interaction-neutral-hover);
@@ -71,11 +82,23 @@
71
82
  /* Higher specificity (2 classes) ensures disabled color beats any 1-class color rule */
72
83
  &.chip--disabled {
73
84
  color: var(--color-text-disabled);
85
+
86
+ &:visited,
87
+ &:active,
88
+ &:hover {
89
+ color: var(--color-text-disabled);
90
+ }
74
91
  }
75
92
 
76
93
  &.chip--active.chip--disabled {
77
94
  background-color: var(--color-button-disabled);
78
95
  color: var(--color-text-blank);
96
+
97
+ &:visited,
98
+ &:active,
99
+ &:hover {
100
+ color: var(--color-text-blank);
101
+ }
79
102
  }
80
103
  }
81
104
 
@@ -109,6 +132,12 @@
109
132
  background-color: var(--color-background-secondary);
110
133
  border-color: var(--color-border-regular);
111
134
  color: var(--color-text-disabled);
135
+
136
+ &:visited,
137
+ &:active,
138
+ &:hover {
139
+ color: var(--color-text-disabled);
140
+ }
112
141
  }
113
142
 
114
143
  &.chip--active.chip--disabled {
@@ -143,6 +172,12 @@
143
172
  &.chip--disabled {
144
173
  background-color: var(--color-background-primary);
145
174
  color: var(--color-text-disabled);
175
+
176
+ &:visited,
177
+ &:active,
178
+ &:hover {
179
+ color: var(--color-text-disabled);
180
+ }
146
181
  }
147
182
  }
148
183
 
@@ -24,6 +24,7 @@
24
24
  left: 0;
25
25
  width: 100vw;
26
26
  height: 100vh;
27
+ height: 100dvh;
27
28
  z-index: 1600;
28
29
  min-height: -webkit-fill-available;
29
30
 
@@ -49,6 +50,7 @@
49
50
  left: 0;
50
51
  width: 100%;
51
52
  max-height: calc(100vh - 12px);
53
+ max-height: calc(100dvh - 12px);
52
54
  background-color: var(--color-background-primary);
53
55
  border-top-left-radius: 20px;
54
56
  border-top-right-radius: 20px;
@@ -67,6 +69,7 @@
67
69
  animation: 0.2s ease-out 0s 1 drawer-scale-to-full;
68
70
  max-width: 480px;
69
71
  max-height: calc(100vh - 80px);
72
+ max-height: calc(100dvh - 80px);
70
73
  margin-top: 40px;
71
74
  margin-bottom: 40px;
72
75
 
@@ -95,12 +98,14 @@
95
98
  &.half-height {
96
99
  height: auto;
97
100
  max-height: 50vh;
101
+ max-height: 50dvh;
98
102
  transition:
99
103
  max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
100
104
  transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
101
105
 
102
106
  &.is-expanded {
103
107
  max-height: calc(100vh - 12px);
108
+ max-height: calc(100dvh - 12px);
104
109
  }
105
110
  }
106
111
  }
@@ -324,6 +329,7 @@
324
329
  flex: 1;
325
330
  min-height: 0;
326
331
  max-height: calc(100vh - 120px);
332
+ max-height: calc(100dvh - 120px);
327
333
  padding: 12px 16px;
328
334
  margin: 0 -16px 0;
329
335
  overflow-y: auto;
@@ -336,6 +342,7 @@
336
342
 
337
343
  &.no-button {
338
344
  max-height: calc(100vh - 76px);
345
+ max-height: calc(100dvh - 76px);
339
346
  }
340
347
 
341
348
  &.children-overflow-visible {
@@ -355,9 +362,11 @@
355
362
  padding: 16px 20px;
356
363
  margin: 0 -24px;
357
364
  max-height: calc(100vh - 144px);
365
+ max-height: calc(100dvh - 144px);
358
366
 
359
367
  &.no-button {
360
368
  max-height: calc(100vh - 88px);
369
+ max-height: calc(100dvh - 88px);
361
370
  }
362
371
  }
363
372
  }
@@ -17,6 +17,7 @@
17
17
  left: 0;
18
18
  width: 100vw;
19
19
  height: 100vh;
20
+ height: 100dvh;
20
21
  padding: 12px;
21
22
  z-index: 1600;
22
23
  min-height: -webkit-fill-available;
@@ -96,6 +97,7 @@
96
97
  font-size: var(--font-size-sm);
97
98
  line-height: 20px;
98
99
  max-height: calc(100vh - 280px);
100
+ max-height: calc(100dvh - 280px);
99
101
  width: calc(100% + 12px * 2);
100
102
  padding: 0 12px;
101
103
  margin: 0 -12px 24px;
@@ -104,6 +106,7 @@
104
106
 
105
107
  &.no-button {
106
108
  max-height: calc(100vh - 224px);
109
+ max-height: calc(100dvh - 224px);
107
110
  margin-bottom: 0;
108
111
  }
109
112
 
@@ -121,9 +124,11 @@
121
124
  padding: 0 24px;
122
125
  margin: 0 -24px 24px;
123
126
  max-height: calc(100vh - 248px);
127
+ max-height: calc(100dvh - 248px);
124
128
 
125
129
  &.no-button {
126
130
  max-height: calc(100vh - 192px);
131
+ max-height: calc(100dvh - 192px);
127
132
  }
128
133
  }
129
134
  }
@@ -34,6 +34,7 @@
34
34
  left: 0;
35
35
  width: 100vw;
36
36
  height: 100vh;
37
+ height: 100dvh;
37
38
  z-index: 1600;
38
39
  min-height: -webkit-fill-available;
39
40
 
@@ -178,18 +179,22 @@
178
179
 
179
180
  &.half {
180
181
  max-height: calc(50vh - 108px);
182
+ max-height: calc(50dvh - 108px);
181
183
  }
182
184
 
183
185
  &.half.no-button {
184
186
  max-height: calc(50vh - 64px);
187
+ max-height: calc(50dvh - 64px);
185
188
  }
186
189
 
187
190
  &.full {
188
191
  max-height: calc(100vh - 120px);
192
+ max-height: calc(100dvh - 120px);
189
193
  }
190
194
 
191
195
  &.full.no-button {
192
196
  max-height: calc(100vh - 76px);
197
+ max-height: calc(100dvh - 76px);
193
198
  }
194
199
 
195
200
  @media screen and (min-width: 768px) {
@@ -197,9 +202,11 @@
197
202
  padding: 0 24px;
198
203
  margin: 0 -24px 24px;
199
204
  max-height: calc(100vh - 144px);
205
+ max-height: calc(100dvh - 144px);
200
206
 
201
207
  &.no-button {
202
208
  max-height: calc(100vh - 88px);
209
+ max-height: calc(100dvh - 88px);
203
210
  }
204
211
  }
205
212
 
@@ -17,6 +17,7 @@
17
17
  left: 0;
18
18
  width: 100vw;
19
19
  height: 100vh;
20
+ height: 100dvh;
20
21
  padding: 12px;
21
22
  z-index: 1600;
22
23
  }
@@ -174,6 +175,7 @@
174
175
  font-size: var(--font-size-sm);
175
176
  line-height: 20px;
176
177
  max-height: calc(100vh - 280px);
178
+ max-height: calc(100dvh - 280px);
177
179
  width: calc(100% + 16px * 2);
178
180
  padding: 0 12px;
179
181
  margin: 0 -12px 16px;
@@ -182,6 +184,7 @@
182
184
 
183
185
  &.no-button {
184
186
  max-height: calc(100vh - 224px);
187
+ max-height: calc(100dvh - 224px);
185
188
  margin-bottom: 0;
186
189
  }
187
190
 
@@ -204,9 +207,11 @@
204
207
  margin: 0 -16px 16px;
205
208
  text-align: left;
206
209
  max-height: calc(100vh - 248px);
210
+ max-height: calc(100dvh - 248px);
207
211
 
208
212
  &.no-button {
209
213
  max-height: calc(100vh - 192px);
214
+ max-height: calc(100dvh - 192px);
210
215
  }
211
216
  }
212
217
  }
@@ -299,6 +304,7 @@
299
304
  position: relative;
300
305
  padding: 12px 16px;
301
306
  max-height: calc(100vh - 200px);
307
+ max-height: calc(100dvh - 200px);
302
308
  overflow-y: auto;
303
309
  box-sizing: border-box;
304
310