cetec-design-system 2.0.2-0 → 2.1.0-next.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/README.md +2 -0
- package/dist/{cetec-preset-CMHb1Xn9.js → cetec-preset-DfIlhu92.js} +286 -4
- package/dist/cetec-preset-DfIlhu92.js.map +1 -0
- package/dist/index.js +638 -71
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +14 -5
- package/dist/preset.js +1 -1
- package/dist/specs/recipes.json +33 -0
- package/dist/styles.css +273 -10
- package/dist/types/index.d.ts +113 -37
- package/package.json +1 -1
- package/src/recipes/checkbox.ts +13 -2
- package/src/recipes/icon.ts +1 -0
- package/src/recipes/radio.ts +3 -0
- package/src/recipes/recipes-slot.ts +1 -0
- package/src/recipes/select.ts +268 -0
- package/src/recipes/tag.ts +2 -0
- package/src/utils/useControllableState.ts +35 -0
- package/dist/cetec-preset-CMHb1Xn9.js.map +0 -1
package/README.md
CHANGED
|
@@ -104,6 +104,8 @@ This design system is built on **Panda CSS** with a strict tokens-first approach
|
|
|
104
104
|
- Type props with TypeScript strict mode
|
|
105
105
|
- Style with Panda recipes (no inline styles or hard-coded values)
|
|
106
106
|
- Follow accessibility guidelines (semantic HTML, keyboard support, ARIA when needed)
|
|
107
|
+
- Native form controls support both controlled and uncontrolled usage where it fits the element semantics. Use `checked` / `value` when React owns the state, and `defaultChecked` / `defaultValue` / `defaultOpen` when the browser or widget should own the initial state.
|
|
108
|
+
- Binary and group-based controls (`Checkbox`, `Radio`, `Toggle`, `Select`, `DatePicker`, `TimePicker`, `ChipGroup`) now expose explicit uncontrolled entrypoints so static pages can avoid hydration when they do not need React state.
|
|
107
109
|
|
|
108
110
|
Also see [Component Standards](./src/storybook/docs/componentStandards.mdx)
|
|
109
111
|
|
|
@@ -5543,6 +5543,8 @@ const tagRecipe = defineRecipe({
|
|
|
5543
5543
|
variant: "default",
|
|
5544
5544
|
hue: "slate"
|
|
5545
5545
|
},
|
|
5546
|
+
// validate-ignore: avoid-compound-variants-in-recipes — tag color pairing is a fixed token matrix and clearer as declarative compound variants
|
|
5547
|
+
// eslint-disable-next-line cetec/avoid-compound-variants-in-recipes
|
|
5546
5548
|
compoundVariants: [
|
|
5547
5549
|
{
|
|
5548
5550
|
hue: "slate",
|
|
@@ -5874,6 +5876,7 @@ const iconRecipe = defineRecipe({
|
|
|
5874
5876
|
base: {
|
|
5875
5877
|
aspectRatio: "square",
|
|
5876
5878
|
fill: "icon.decorative",
|
|
5879
|
+
flexShrink: 0,
|
|
5877
5880
|
w: "24"
|
|
5878
5881
|
// Default size here does not affect the classNames, so it's safe to set
|
|
5879
5882
|
},
|
|
@@ -6343,6 +6346,12 @@ const checkboxRecipe = defineSlotRecipe({
|
|
|
6343
6346
|
display: "inline-grid",
|
|
6344
6347
|
zIndex: "3"
|
|
6345
6348
|
},
|
|
6349
|
+
"& ~ [name='checkbox-checked']": {
|
|
6350
|
+
display: "none"
|
|
6351
|
+
},
|
|
6352
|
+
"& ~ [name='checkbox-indeterminate']": {
|
|
6353
|
+
display: "none"
|
|
6354
|
+
},
|
|
6346
6355
|
_checked: {
|
|
6347
6356
|
"& ~ [name='checkbox-checked']": {
|
|
6348
6357
|
display: "inline-grid",
|
|
@@ -6351,17 +6360,22 @@ const checkboxRecipe = defineSlotRecipe({
|
|
|
6351
6360
|
},
|
|
6352
6361
|
"& ~ [name='checkbox']": {
|
|
6353
6362
|
display: "none"
|
|
6363
|
+
},
|
|
6364
|
+
"& ~ [name='checkbox-indeterminate']": {
|
|
6365
|
+
display: "none"
|
|
6354
6366
|
}
|
|
6355
6367
|
},
|
|
6356
|
-
|
|
6368
|
+
"&[data-indeterminate]": {
|
|
6357
6369
|
"& ~ [name='checkbox-indeterminate']": {
|
|
6358
6370
|
display: "inline-grid",
|
|
6359
6371
|
fill: "icon",
|
|
6360
|
-
zIndex: "3"
|
|
6361
|
-
_disabled: {}
|
|
6372
|
+
zIndex: "3"
|
|
6362
6373
|
},
|
|
6363
6374
|
"& ~ [name='checkbox']": {
|
|
6364
6375
|
display: "none"
|
|
6376
|
+
},
|
|
6377
|
+
"& ~ [name='checkbox-checked']": {
|
|
6378
|
+
display: "none"
|
|
6365
6379
|
}
|
|
6366
6380
|
},
|
|
6367
6381
|
_error: {
|
|
@@ -6431,6 +6445,9 @@ const radioRecipe = defineSlotRecipe({
|
|
|
6431
6445
|
display: "inline-grid",
|
|
6432
6446
|
zIndex: "zIndex.3"
|
|
6433
6447
|
},
|
|
6448
|
+
"& ~ [name='radio-checked']": {
|
|
6449
|
+
display: "none"
|
|
6450
|
+
},
|
|
6434
6451
|
_checked: {
|
|
6435
6452
|
"& ~ [name='radio-checked']": {
|
|
6436
6453
|
display: "inline-grid",
|
|
@@ -8318,6 +8335,270 @@ const breadcrumbsRecipe = defineSlotRecipe({
|
|
|
8318
8335
|
}
|
|
8319
8336
|
}
|
|
8320
8337
|
});
|
|
8338
|
+
const selectBase = {
|
|
8339
|
+
root: {
|
|
8340
|
+
"--icon-size": "token(sizes.24)",
|
|
8341
|
+
"--icon-margin": "token(sizes.3)",
|
|
8342
|
+
"--input-icon-padding": "token(sizes.10)",
|
|
8343
|
+
display: "inline-flex",
|
|
8344
|
+
flexDirection: "column",
|
|
8345
|
+
position: "relative",
|
|
8346
|
+
minWidth: "0",
|
|
8347
|
+
maxW: "full",
|
|
8348
|
+
width: "fit"
|
|
8349
|
+
},
|
|
8350
|
+
trigger: {
|
|
8351
|
+
position: "relative",
|
|
8352
|
+
display: "inline-flex",
|
|
8353
|
+
alignItems: "center",
|
|
8354
|
+
width: "fit",
|
|
8355
|
+
minWidth: "0",
|
|
8356
|
+
maxWidth: "full",
|
|
8357
|
+
pe: "var(--input-icon-padding)",
|
|
8358
|
+
borderWidth: "1",
|
|
8359
|
+
borderStyle: "solid",
|
|
8360
|
+
borderColor: "border.input",
|
|
8361
|
+
borderRadius: "4",
|
|
8362
|
+
outlineWidth: "2",
|
|
8363
|
+
outlineOffset: "-1",
|
|
8364
|
+
outlineStyle: "solid",
|
|
8365
|
+
outlineColor: "transparent",
|
|
8366
|
+
bg: "bg.input",
|
|
8367
|
+
color: "text",
|
|
8368
|
+
fontFamily: "body",
|
|
8369
|
+
lineHeight: "default",
|
|
8370
|
+
cursor: "pointer",
|
|
8371
|
+
overflow: "hidden",
|
|
8372
|
+
transitionDuration: "fast",
|
|
8373
|
+
transitionProperty: "background, border-color, outline-color",
|
|
8374
|
+
transitionTimingFunction: "default",
|
|
8375
|
+
_hover: {
|
|
8376
|
+
bg: "bg.input.hovered"
|
|
8377
|
+
},
|
|
8378
|
+
_focusVisible: {
|
|
8379
|
+
bg: "bg.input.pressed",
|
|
8380
|
+
borderColor: "border.focused",
|
|
8381
|
+
outlineColor: "border.focused"
|
|
8382
|
+
},
|
|
8383
|
+
_open: {
|
|
8384
|
+
bg: "bg.input.pressed",
|
|
8385
|
+
borderColor: "border.focused",
|
|
8386
|
+
outlineColor: "border.focused"
|
|
8387
|
+
},
|
|
8388
|
+
_disabled: {
|
|
8389
|
+
bg: "bg.disabled",
|
|
8390
|
+
borderColor: "border.disabled",
|
|
8391
|
+
color: "text.disabled",
|
|
8392
|
+
cursor: "not-allowed",
|
|
8393
|
+
pointerEvents: "none"
|
|
8394
|
+
},
|
|
8395
|
+
_error: {
|
|
8396
|
+
borderColor: "border.danger",
|
|
8397
|
+
_hover: {
|
|
8398
|
+
borderColor: "border.danger"
|
|
8399
|
+
},
|
|
8400
|
+
_focusVisible: {
|
|
8401
|
+
borderColor: "border.danger",
|
|
8402
|
+
outlineColor: "border.danger"
|
|
8403
|
+
},
|
|
8404
|
+
_open: {
|
|
8405
|
+
borderColor: "border.danger",
|
|
8406
|
+
outlineColor: "border.danger"
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
},
|
|
8410
|
+
content: {
|
|
8411
|
+
display: "flex",
|
|
8412
|
+
alignItems: "center",
|
|
8413
|
+
minWidth: "0",
|
|
8414
|
+
width: "full",
|
|
8415
|
+
flex: "1"
|
|
8416
|
+
},
|
|
8417
|
+
value: {
|
|
8418
|
+
flex: 1,
|
|
8419
|
+
minWidth: "0",
|
|
8420
|
+
textAlign: "left",
|
|
8421
|
+
truncate: true,
|
|
8422
|
+
color: "text"
|
|
8423
|
+
},
|
|
8424
|
+
placeholder: {
|
|
8425
|
+
flex: 1,
|
|
8426
|
+
minWidth: "0",
|
|
8427
|
+
textAlign: "left",
|
|
8428
|
+
truncate: true,
|
|
8429
|
+
color: "text.placeholder"
|
|
8430
|
+
},
|
|
8431
|
+
chips: {
|
|
8432
|
+
display: "flex",
|
|
8433
|
+
alignItems: "center",
|
|
8434
|
+
gap: "4",
|
|
8435
|
+
minWidth: "0",
|
|
8436
|
+
width: "full",
|
|
8437
|
+
flex: "1",
|
|
8438
|
+
overflowX: "auto",
|
|
8439
|
+
overflowY: "hidden",
|
|
8440
|
+
scrollbarWidth: "thin"
|
|
8441
|
+
},
|
|
8442
|
+
icon: {
|
|
8443
|
+
position: "absolute",
|
|
8444
|
+
top: "50%",
|
|
8445
|
+
right: "1",
|
|
8446
|
+
display: "inline-flex",
|
|
8447
|
+
alignItems: "center",
|
|
8448
|
+
justifyContent: "center",
|
|
8449
|
+
width: "var(--icon-size)",
|
|
8450
|
+
height: "var(--icon-size)",
|
|
8451
|
+
marginInline: "var(--icon-margin)",
|
|
8452
|
+
transform: "translateY(-50%)",
|
|
8453
|
+
bg: "bg.input",
|
|
8454
|
+
fill: "icon.decorative",
|
|
8455
|
+
pointerEvents: "none",
|
|
8456
|
+
transitionDuration: "fast",
|
|
8457
|
+
transitionProperty: "all",
|
|
8458
|
+
transitionTimingFunction: "default",
|
|
8459
|
+
_icon: {
|
|
8460
|
+
width: "var(--icon-size)",
|
|
8461
|
+
height: "var(--icon-size)",
|
|
8462
|
+
transitionDuration: "fast",
|
|
8463
|
+
transitionProperty: "all",
|
|
8464
|
+
transitionTimingFunction: "default"
|
|
8465
|
+
},
|
|
8466
|
+
_peerHover: {
|
|
8467
|
+
bg: "bg.input.hovered"
|
|
8468
|
+
},
|
|
8469
|
+
_open: {
|
|
8470
|
+
"& > svg": {
|
|
8471
|
+
transform: "rotate(-180deg)",
|
|
8472
|
+
transformOrigin: "center"
|
|
8473
|
+
}
|
|
8474
|
+
}
|
|
8475
|
+
}
|
|
8476
|
+
};
|
|
8477
|
+
const selectVariants = {
|
|
8478
|
+
size: {
|
|
8479
|
+
sm: {
|
|
8480
|
+
root: {
|
|
8481
|
+
"--icon-size": "token(sizes.22)",
|
|
8482
|
+
"--icon-margin": "token(sizes.2)",
|
|
8483
|
+
"--input-icon-padding": "[26px]"
|
|
8484
|
+
},
|
|
8485
|
+
content: {
|
|
8486
|
+
py: "0",
|
|
8487
|
+
ps: "8",
|
|
8488
|
+
fontSize: "14"
|
|
8489
|
+
},
|
|
8490
|
+
chips: {
|
|
8491
|
+
gap: "3",
|
|
8492
|
+
py: "2"
|
|
8493
|
+
}
|
|
8494
|
+
},
|
|
8495
|
+
md: {
|
|
8496
|
+
root: {
|
|
8497
|
+
"--icon-size": "token(sizes.24)",
|
|
8498
|
+
"--icon-margin": "token(sizes.3)",
|
|
8499
|
+
"--input-icon-padding": "[31px]"
|
|
8500
|
+
},
|
|
8501
|
+
content: {
|
|
8502
|
+
py: "3",
|
|
8503
|
+
ps: "10",
|
|
8504
|
+
fontSize: "16"
|
|
8505
|
+
},
|
|
8506
|
+
chips: {
|
|
8507
|
+
gap: "4",
|
|
8508
|
+
py: "5"
|
|
8509
|
+
}
|
|
8510
|
+
},
|
|
8511
|
+
lg: {
|
|
8512
|
+
root: {
|
|
8513
|
+
"--icon-size": "token(sizes.24)",
|
|
8514
|
+
"--icon-margin": "token(sizes.5)",
|
|
8515
|
+
"--input-icon-padding": "[34px]"
|
|
8516
|
+
},
|
|
8517
|
+
content: {
|
|
8518
|
+
py: "7",
|
|
8519
|
+
ps: "12",
|
|
8520
|
+
fontSize: "16"
|
|
8521
|
+
},
|
|
8522
|
+
chips: {
|
|
8523
|
+
gap: "5",
|
|
8524
|
+
py: "0"
|
|
8525
|
+
}
|
|
8526
|
+
},
|
|
8527
|
+
xl: {
|
|
8528
|
+
root: {
|
|
8529
|
+
"--icon-size": "token(sizes.28)",
|
|
8530
|
+
"--icon-margin": "token(sizes.7)",
|
|
8531
|
+
"--input-icon-padding": "[42px]"
|
|
8532
|
+
},
|
|
8533
|
+
content: {
|
|
8534
|
+
py: "9",
|
|
8535
|
+
ps: "16",
|
|
8536
|
+
fontSize: "20"
|
|
8537
|
+
},
|
|
8538
|
+
chips: {
|
|
8539
|
+
gap: "6",
|
|
8540
|
+
py: "2"
|
|
8541
|
+
}
|
|
8542
|
+
}
|
|
8543
|
+
},
|
|
8544
|
+
multiple: {
|
|
8545
|
+
true: {
|
|
8546
|
+
trigger: {
|
|
8547
|
+
alignItems: "flex-start"
|
|
8548
|
+
},
|
|
8549
|
+
content: {
|
|
8550
|
+
alignItems: "flex-start"
|
|
8551
|
+
}
|
|
8552
|
+
}
|
|
8553
|
+
},
|
|
8554
|
+
autoSize: {
|
|
8555
|
+
true: {
|
|
8556
|
+
trigger: {
|
|
8557
|
+
height: "auto"
|
|
8558
|
+
},
|
|
8559
|
+
value: {
|
|
8560
|
+
whiteSpace: "normal",
|
|
8561
|
+
textWrap: "wrap",
|
|
8562
|
+
overflow: "visible",
|
|
8563
|
+
textOverflow: "clip"
|
|
8564
|
+
},
|
|
8565
|
+
placeholder: {
|
|
8566
|
+
whiteSpace: "normal",
|
|
8567
|
+
textWrap: "wrap",
|
|
8568
|
+
overflow: "visible",
|
|
8569
|
+
textOverflow: "clip"
|
|
8570
|
+
},
|
|
8571
|
+
chips: {
|
|
8572
|
+
flexWrap: "wrap",
|
|
8573
|
+
overflowX: "visible",
|
|
8574
|
+
overflowY: "visible"
|
|
8575
|
+
}
|
|
8576
|
+
},
|
|
8577
|
+
false: {
|
|
8578
|
+
chips: {
|
|
8579
|
+
flexWrap: "nowrap"
|
|
8580
|
+
}
|
|
8581
|
+
}
|
|
8582
|
+
}
|
|
8583
|
+
};
|
|
8584
|
+
const selectRecipe = defineSlotRecipe({
|
|
8585
|
+
className: "select",
|
|
8586
|
+
jsx: ["Select"],
|
|
8587
|
+
slots: [
|
|
8588
|
+
"root",
|
|
8589
|
+
"trigger",
|
|
8590
|
+
"content",
|
|
8591
|
+
"value",
|
|
8592
|
+
"placeholder",
|
|
8593
|
+
"chips",
|
|
8594
|
+
"icon"
|
|
8595
|
+
],
|
|
8596
|
+
base: selectBase,
|
|
8597
|
+
variants: selectVariants,
|
|
8598
|
+
defaultVariants: {
|
|
8599
|
+
size: "md"
|
|
8600
|
+
}
|
|
8601
|
+
});
|
|
8321
8602
|
const kbdRecipe = defineSlotRecipe({
|
|
8322
8603
|
className: "kbd",
|
|
8323
8604
|
slots: ["kbdGroup", "key"],
|
|
@@ -8386,6 +8667,7 @@ const slotRecipes = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
8386
8667
|
menuRecipe,
|
|
8387
8668
|
modalRecipe,
|
|
8388
8669
|
radioRecipe,
|
|
8670
|
+
selectRecipe,
|
|
8389
8671
|
textInputRecipe,
|
|
8390
8672
|
timePickerRecipe,
|
|
8391
8673
|
tooltipRecipe
|
|
@@ -9707,4 +9989,4 @@ export {
|
|
|
9707
9989
|
breakpoints as b,
|
|
9708
9990
|
containerSizes as c
|
|
9709
9991
|
};
|
|
9710
|
-
//# sourceMappingURL=cetec-preset-
|
|
9992
|
+
//# sourceMappingURL=cetec-preset-DfIlhu92.js.map
|