@ceebee/ui 1.4.1 → 1.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.
- package/dist/client.d.ts +39 -13
- package/dist/client.js +699 -5
- package/dist/index.d.ts +25 -1
- package/dist/index.js +684 -1
- package/dist/styles.css +111 -9
- package/package.json +7 -6
package/dist/styles.css
CHANGED
|
@@ -1919,13 +1919,21 @@ html, body { background: var(--cb-bg); color: var(--cb-fg); }
|
|
|
1919
1919
|
the ones Ant already puts in the server-rendered markup, including its variant and size classes,
|
|
1920
1920
|
so a first paint can respect them. */
|
|
1921
1921
|
|
|
1922
|
+
/* Sizes below are Ant's own derived values, read out of a rendered control and then expressed in
|
|
1923
|
+
Tokens rather than guessed: Ant lands on a spacing Token less its own border width, so
|
|
1924
|
+
`space-4 - border-width` is 15px and `space-3 - border-width` is 11px. Where a variant's geometry
|
|
1925
|
+
has not been measured that way, this layer states no size for it — a wrong size flickers as badly
|
|
1926
|
+
as no size, and pretends to be right. */
|
|
1927
|
+
|
|
1922
1928
|
:where(.ant-btn) {
|
|
1929
|
+
box-sizing: border-box;
|
|
1923
1930
|
display: inline-flex;
|
|
1924
1931
|
height: var(--cb-control-height-md);
|
|
1925
1932
|
align-items: center;
|
|
1926
1933
|
justify-content: center;
|
|
1927
1934
|
gap: var(--cb-space-2);
|
|
1928
|
-
padding-
|
|
1935
|
+
padding-block: var(--cb-space-0);
|
|
1936
|
+
padding-inline: calc(var(--cb-space-4) - var(--cb-border-width));
|
|
1929
1937
|
border: var(--cb-border-width) solid var(--cb-border-strong);
|
|
1930
1938
|
border-radius: var(--cb-radius-sm);
|
|
1931
1939
|
background: var(--cb-surface);
|
|
@@ -1934,20 +1942,21 @@ html, body { background: var(--cb-bg); color: var(--cb-fg); }
|
|
|
1934
1942
|
font-size: var(--cb-text-sm);
|
|
1935
1943
|
}
|
|
1936
1944
|
|
|
1945
|
+
/* Height and type scale come straight from the Tokens the bridge already hands Ant, so they agree.
|
|
1946
|
+
The inline padding of these two sizes has not been measured, so it is left to Ant. */
|
|
1937
1947
|
:where(.ant-btn-sm) {
|
|
1938
1948
|
height: var(--cb-control-height-sm);
|
|
1939
|
-
padding-inline: var(--cb-space-3);
|
|
1940
1949
|
font-size: var(--cb-text-xs);
|
|
1941
1950
|
}
|
|
1942
1951
|
|
|
1943
1952
|
:where(.ant-btn-lg) {
|
|
1944
1953
|
height: var(--cb-control-height-lg);
|
|
1945
|
-
padding-inline: var(--cb-space-5);
|
|
1946
1954
|
font-size: var(--cb-text-md);
|
|
1947
1955
|
}
|
|
1948
1956
|
|
|
1949
1957
|
:where(.ant-btn-icon-only) {
|
|
1950
|
-
|
|
1958
|
+
width: var(--cb-control-height-md);
|
|
1959
|
+
padding-inline: var(--cb-space-0);
|
|
1951
1960
|
}
|
|
1952
1961
|
|
|
1953
1962
|
:where(.ant-btn-block) {
|
|
@@ -1967,7 +1976,15 @@ html, body { background: var(--cb-bg); color: var(--cb-fg); }
|
|
|
1967
1976
|
color: var(--cb-fg-on-brand);
|
|
1968
1977
|
}
|
|
1969
1978
|
|
|
1970
|
-
|
|
1979
|
+
/* The framed text controls. `.ant-select` carries its own box in this runtime — the inner element is
|
|
1980
|
+
`.ant-select-content`, not a selector class this layer needs to name. */
|
|
1981
|
+
:where(.ant-input, .ant-input-affix-wrapper, .ant-select) {
|
|
1982
|
+
box-sizing: border-box;
|
|
1983
|
+
display: flex;
|
|
1984
|
+
height: var(--cb-control-height-md);
|
|
1985
|
+
align-items: center;
|
|
1986
|
+
padding-block: var(--cb-space-2);
|
|
1987
|
+
padding-inline: calc(var(--cb-space-3) - var(--cb-border-width));
|
|
1971
1988
|
border: var(--cb-border-width) solid var(--cb-border-strong);
|
|
1972
1989
|
border-radius: var(--cb-radius-sm);
|
|
1973
1990
|
background: var(--cb-surface);
|
|
@@ -1976,10 +1993,57 @@ html, body { background: var(--cb-bg); color: var(--cb-fg); }
|
|
|
1976
1993
|
font-size: var(--cb-text-sm);
|
|
1977
1994
|
}
|
|
1978
1995
|
|
|
1979
|
-
|
|
1996
|
+
:where(.ant-input-lg, .ant-input-affix-wrapper-lg, .ant-select-lg) {
|
|
1997
|
+
height: var(--cb-control-height-lg);
|
|
1998
|
+
padding-block: calc(var(--cb-space-3) - var(--cb-border-width));
|
|
1999
|
+
border-radius: var(--cb-radius-md);
|
|
2000
|
+
font-size: var(--cb-text-md);
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
:where(.ant-input-sm, .ant-input-affix-wrapper-sm, .ant-select-sm) {
|
|
2004
|
+
height: var(--cb-control-height-sm);
|
|
2005
|
+
font-size: var(--cb-text-xs);
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
/* An input inside an affix wrapper is framed by the wrapper, so it states no box of its own. */
|
|
1980
2009
|
:where(.ant-input-affix-wrapper .ant-input) {
|
|
2010
|
+
width: 100%;
|
|
2011
|
+
height: auto;
|
|
2012
|
+
padding: var(--cb-space-0);
|
|
1981
2013
|
border: none;
|
|
2014
|
+
border-radius: var(--cb-radius-none);
|
|
1982
2015
|
background: transparent;
|
|
2016
|
+
font-size: inherit;
|
|
2017
|
+
line-height: var(--cb-leading-normal);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
/* The prefix sets the text's starting position, so leaving its spacing out moved the placeholder
|
|
2021
|
+
sideways when Ant landed. Measured: Ant states `margin-inline-end` here, and its value is one
|
|
2022
|
+
space step, mirrored on the suffix, which Ant spaces the same way. */
|
|
2023
|
+
:where(.ant-input-prefix, .ant-input-suffix) {
|
|
2024
|
+
display: flex;
|
|
2025
|
+
flex: none;
|
|
2026
|
+
align-items: center;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
:where(.ant-input-prefix) {
|
|
2030
|
+
margin-inline-end: var(--cb-space-1);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
:where(.ant-input-suffix) {
|
|
2034
|
+
margin-inline-start: var(--cb-space-1);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/* `allowClear` renders its clear control on an empty field and hides it from JavaScript-built CSS.
|
|
2038
|
+
Without that rule a stray clear icon is painted in every input until hydration, so the hidden
|
|
2039
|
+
state is stated here too. */
|
|
2040
|
+
:where(.ant-input-clear-icon) {
|
|
2041
|
+
font-size: var(--cb-text-xs);
|
|
2042
|
+
color: var(--cb-fg-subtle);
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
:where(.ant-input-clear-icon-hidden) {
|
|
2046
|
+
visibility: hidden;
|
|
1983
2047
|
}
|
|
1984
2048
|
|
|
1985
2049
|
/* A pseudo-element cannot live inside `:where()` — the rule would be dropped — so it sits outside
|
|
@@ -1989,15 +2053,53 @@ html, body { background: var(--cb-bg); color: var(--cb-fg); }
|
|
|
1989
2053
|
color: var(--cb-fg-muted);
|
|
1990
2054
|
}
|
|
1991
2055
|
|
|
2056
|
+
/* Segmented is measured at a 6px radius and 2px of inline padding, and no Token carries either
|
|
2057
|
+
value — Ant derives them through its own algorithm from tokens the bridge does not feed. So this
|
|
2058
|
+
states no size or radius for it, only the axis it lays out on, which it otherwise loses entirely
|
|
2059
|
+
and stacks vertically, and the colours, which are Tokens. */
|
|
2060
|
+
/* Checkbox server-renders with no box at all until Ant lands: no border, no background, so a reader
|
|
2061
|
+
sees nothing where a checkbox belongs. Ant sizes its interactive controls at half the control
|
|
2062
|
+
height — `controlInteractiveSize` is `controlHeight / 2` in Ant's own token deriver, checked
|
|
2063
|
+
against it — so that size is derived rather than guessed. Its 6px corner comes from
|
|
2064
|
+
`borderRadiusSM`, which no Ceebee Token carries, so no radius is stated here: a square box for one
|
|
2065
|
+
paint is honest, a nearly-right radius is not. */
|
|
2066
|
+
:where(.ant-checkbox-wrapper) {
|
|
2067
|
+
display: flex;
|
|
2068
|
+
align-items: center;
|
|
2069
|
+
font-family: var(--cb-font-sans);
|
|
2070
|
+
font-size: var(--cb-text-sm);
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
/* The box is `.ant-checkbox` itself in this runtime; there is no `-inner` element, and a rule
|
|
2074
|
+
naming one matches nothing. It is a `span`, so it needs a block-ish display before a size means
|
|
2075
|
+
anything. */
|
|
2076
|
+
:where(.ant-checkbox) {
|
|
2077
|
+
display: inline-block;
|
|
2078
|
+
flex: none;
|
|
2079
|
+
width: calc(var(--cb-control-height-md) / 2);
|
|
2080
|
+
height: calc(var(--cb-control-height-md) / 2);
|
|
2081
|
+
border: var(--cb-border-width) solid var(--cb-border-strong);
|
|
2082
|
+
background: var(--cb-surface);
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
/* Measured at one space step on each side, which is exactly the 16px the wrapper was short. */
|
|
2086
|
+
:where(.ant-checkbox-label) {
|
|
2087
|
+
padding-inline: var(--cb-space-2);
|
|
2088
|
+
}
|
|
2089
|
+
|
|
1992
2090
|
:where(.ant-segmented) {
|
|
1993
|
-
border-radius: var(--cb-radius-sm);
|
|
1994
2091
|
background: var(--cb-bg-subtle);
|
|
1995
2092
|
font-family: var(--cb-font-sans);
|
|
1996
|
-
font-size: var(--cb-text-
|
|
2093
|
+
font-size: var(--cb-text-sm);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/* The options are laid out by an inner group, not by the root, so without this the control paints
|
|
2097
|
+
as a vertical stack of labels. */
|
|
2098
|
+
:where(.ant-segmented-group) {
|
|
2099
|
+
display: flex;
|
|
1997
2100
|
}
|
|
1998
2101
|
|
|
1999
2102
|
:where(.ant-segmented-item) {
|
|
2000
|
-
border-radius: var(--cb-radius-sm);
|
|
2001
2103
|
color: var(--cb-fg-muted);
|
|
2002
2104
|
}
|
|
2003
2105
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ceebee/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Ceebee's design system: tokens, themed primitives, motion, and onboarding.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"./styles.css": "./dist/styles.css",
|
|
36
36
|
"./skins/*.css": "./dist/skins/*.css"
|
|
37
37
|
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsup && node ./stamp-client.mjs && node ./build-css.mjs",
|
|
40
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
41
|
+
},
|
|
38
42
|
"peerDependencies": {
|
|
39
43
|
"@base-ui/react": "^1.7.0",
|
|
40
44
|
"lucide-react": ">=0.400.0",
|
|
@@ -54,11 +58,8 @@
|
|
|
54
58
|
"typescript": "^5.7.2"
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
61
|
+
"@ant-design/cssinjs": "2.1.2",
|
|
57
62
|
"antd": "6.6.1",
|
|
58
63
|
"dayjs": "1.11.18"
|
|
59
|
-
},
|
|
60
|
-
"scripts": {
|
|
61
|
-
"build": "tsup && node ./stamp-client.mjs && node ./build-css.mjs",
|
|
62
|
-
"lint": "tsc -p tsconfig.json --noEmit"
|
|
63
64
|
}
|
|
64
|
-
}
|
|
65
|
+
}
|