@microbit/ui 0.1.0-alpha.21 → 0.1.0-alpha.23

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 (97) hide show
  1. package/LICENSE.md +5 -5
  2. package/README.md +29 -13
  3. package/lang/ui.ca.json +12 -12
  4. package/lang/ui.cy.json +4 -4
  5. package/lang/ui.de.json +6 -6
  6. package/lang/ui.es-es.json +5 -5
  7. package/lang/ui.fr.json +6 -6
  8. package/lang/ui.ga-ie.json +6 -6
  9. package/lang/ui.it.json +4 -4
  10. package/lang/ui.ja.json +7 -7
  11. package/lang/ui.ko.json +6 -6
  12. package/lang/ui.lo.json +58 -0
  13. package/lang/ui.nl.json +9 -9
  14. package/lang/ui.pl.json +8 -8
  15. package/lang/ui.pt-br.json +7 -7
  16. package/lang/ui.vi.json +58 -0
  17. package/lang/ui.zh-cn.json +6 -6
  18. package/lang/ui.zh-tw.json +7 -7
  19. package/package.json +1 -1
  20. package/src/Avatar.recipe.ts +16 -20
  21. package/src/Avatar.tsx +31 -29
  22. package/src/Breadcrumb.recipe.ts +3 -7
  23. package/src/Breadcrumb.tsx +6 -8
  24. package/src/Button.recipe.ts +22 -33
  25. package/src/Button.tsx +10 -12
  26. package/src/ButtonGroup.tsx +10 -9
  27. package/src/Card.recipe.ts +1 -2
  28. package/src/Card.tsx +2 -1
  29. package/src/Checkbox.recipe.ts +7 -9
  30. package/src/Checkbox.tsx +2 -3
  31. package/src/CheckboxGroup.tsx +5 -7
  32. package/src/CloseButton.tsx +2 -2
  33. package/src/CloseIcon.tsx +6 -4
  34. package/src/Code.tsx +1 -1
  35. package/src/Collapse.tsx +13 -14
  36. package/src/Divider.tsx +3 -3
  37. package/src/Drawer.recipe.ts +4 -5
  38. package/src/Drawer.tsx +3 -4
  39. package/src/Fade.tsx +6 -10
  40. package/src/Field.recipe.ts +9 -12
  41. package/src/Field.tsx +16 -18
  42. package/src/GridList.recipe.ts +1 -2
  43. package/src/Heading.recipe.ts +5 -5
  44. package/src/Heading.tsx +3 -3
  45. package/src/Icon.tsx +7 -11
  46. package/src/IconButton.tsx +1 -1
  47. package/src/Image.tsx +1 -1
  48. package/src/Input.recipe.ts +5 -6
  49. package/src/Input.tsx +4 -4
  50. package/src/InputGroup.tsx +4 -5
  51. package/src/Kbd.tsx +1 -1
  52. package/src/Link.tsx +2 -2
  53. package/src/LinkBox.tsx +2 -3
  54. package/src/LinkButton.tsx +4 -4
  55. package/src/List.tsx +5 -7
  56. package/src/Menu.recipe.ts +15 -16
  57. package/src/Menu.tsx +9 -13
  58. package/src/Modal.recipe.ts +7 -8
  59. package/src/Modal.tsx +19 -24
  60. package/src/NativeSelect.tsx +16 -16
  61. package/src/NumberField.recipe.ts +25 -11
  62. package/src/NumberField.tsx +4 -4
  63. package/src/PopoverArrow.tsx +1 -2
  64. package/src/ProgressBar.tsx +2 -4
  65. package/src/Radio.recipe.ts +8 -9
  66. package/src/Radio.tsx +2 -2
  67. package/src/RadioGroup.tsx +4 -5
  68. package/src/Select.recipe.ts +9 -9
  69. package/src/Select.tsx +8 -9
  70. package/src/Skeleton.tsx +13 -15
  71. package/src/Slide.tsx +2 -2
  72. package/src/Slider.recipe.ts +11 -14
  73. package/src/Slider.tsx +3 -7
  74. package/src/Spinner.tsx +6 -9
  75. package/src/Svg.tsx +2 -3
  76. package/src/Switch.recipe.ts +4 -5
  77. package/src/Switch.tsx +3 -4
  78. package/src/Text.recipe.ts +4 -7
  79. package/src/Text.tsx +2 -2
  80. package/src/TextField.tsx +3 -4
  81. package/src/Toast.recipe.ts +43 -11
  82. package/src/Toast.tsx +69 -40
  83. package/src/Tooltip.recipe.ts +4 -9
  84. package/src/Tooltip.tsx +48 -10
  85. package/src/TooltipButton.tsx +229 -0
  86. package/src/UnmountCallback.tsx +2 -2
  87. package/src/VisuallyHidden.tsx +1 -1
  88. package/src/base-preset.ts +38 -43
  89. package/src/button-icon.ts +2 -3
  90. package/src/dense-preset.ts +6 -7
  91. package/src/hooks/useBreakpointValue.ts +4 -4
  92. package/src/hooks/useClipboard.ts +5 -6
  93. package/src/hooks/useDisclosure.ts +4 -5
  94. package/src/hooks/useMediaQuery.ts +3 -4
  95. package/src/hooks/usePrevious.ts +1 -4
  96. package/src/index.ts +4 -3
  97. package/src/system.ts +2 -2
package/src/Button.tsx CHANGED
@@ -16,11 +16,11 @@ import { buttonIcon } from "./button-icon";
16
16
  import { uiMessage } from "./messages";
17
17
  import { Spinner } from "./Spinner";
18
18
 
19
- // Chakra's ButtonSpinner: a 1em spinner centred over the hidden label. Out of
20
- // flow, so the label alone sets the button's size; the recipe's base
21
- // `position: relative` is what it anchors to. Its own component so useIntl runs
22
- // only while a button is actually loading — a bare Button must keep working
23
- // without an IntlProvider (test renders commonly lack one).
19
+ // A 1em spinner centred over the hidden label. Out of flow, so the label alone
20
+ // sets the button's size; the recipe's base `position: relative` is what it
21
+ // anchors to. Its own component so useIntl runs only while a button is
22
+ // actually loading — a bare Button must keep working without an IntlProvider
23
+ // (test renders commonly lack one).
24
24
  const ButtonSpinner = () => {
25
25
  const intl = useIntl();
26
26
  return (
@@ -47,16 +47,14 @@ export interface ButtonProps
47
47
  /** Per-instance style overrides, merged after the recipe. */
48
48
  css?: SystemStyleObject;
49
49
  className?: string;
50
- /** Icon rendered before the label, matching Chakra's `leftIcon`. */
50
+ /** Icon rendered before the label. */
51
51
  leftIcon?: ReactNode;
52
- /** Icon rendered after the label, matching Chakra's `rightIcon`. */
52
+ /** Icon rendered after the label. */
53
53
  rightIcon?: ReactNode;
54
54
  /**
55
- * Show a spinner in place of the label and disable interaction, matching
56
- * Chakra's `isLoading`: the label stays in the layout but invisible, so the
57
- * button keeps its size, and the dimmed disabled look applies. Chakra's
58
- * `loadingText`/`spinnerPlacement` (a visible label beside the spinner) are
59
- * unported — no app in the family used them.
55
+ * Show a spinner in place of the label and disable interaction: the label
56
+ * stays in the layout but invisible, so the button keeps its size, and the
57
+ * dimmed disabled look applies.
60
58
  */
61
59
  isLoading?: boolean;
62
60
  children?: ReactNode;
@@ -9,8 +9,8 @@ import { SystemStyleObject } from "styled-system/types";
9
9
 
10
10
  export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
11
11
  /**
12
- * Square the inner radii so adjacent buttons form one control (Chakra's
13
- * `isAttached`). Otherwise buttons get a small gap.
12
+ * Square the inner radii so adjacent buttons form one control. Otherwise
13
+ * buttons get a small gap.
14
14
  */
15
15
  isAttached?: boolean;
16
16
  /** Per-instance style overrides. */
@@ -20,7 +20,7 @@ export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
20
20
 
21
21
  /**
22
22
  * ButtonGroup — lays out related buttons in a row. Works with any button
23
- * elements (shared-ui or native). Replaces Chakra's ButtonGroup.
23
+ * elements (shared-ui or native).
24
24
  */
25
25
  export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
26
26
  function ButtonGroup({ isAttached, css: cssProp, className, ...rest }, ref) {
@@ -33,10 +33,10 @@ export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
33
33
  alignItems: "center",
34
34
  // Buttons are position: relative, so without this an attached
35
35
  // sibling paints over the focused button's focus-ring shadow.
36
- // Chakra raised on :focus, but with the attached -1px overlap a
37
- // raised button also paints over a seam its neighbour draws
38
- // (e.g. a solid split button's white borderLeft), so raise only
39
- // when the ring is actually shown.
36
+ // Raise only on :focus-visible, when the ring is actually shown:
37
+ // with the attached -1px overlap a raised button also paints over
38
+ // a seam its neighbour draws (e.g. a solid split button's white
39
+ // borderLeft).
40
40
  "& > *": { _focusVisible: { zIndex: 1 } },
41
41
  }),
42
42
  isAttached
@@ -45,8 +45,9 @@ export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
45
45
  // :first-child/:last-child, not :first-of-type: attached
46
46
  // groups can mix element types (e.g. select + button), and
47
47
  // -of-type matches per element type.
48
- // marginEnd -1px (Chakra parity): overlaps adjacent borders
49
- // so two 1px inner edges read as a single 1px seam.
48
+ // marginEnd -1px overlaps adjacent borders so two 1px inner
49
+ // edges read as a single 1px seam. That assumes 1px borders;
50
+ // the bordered variants are 2px (microbit-foundation/ui#22).
50
51
  "& > *:first-child:not(:last-child)": {
51
52
  borderEndRadius: 0,
52
53
  marginEnd: "-1px",
@@ -6,8 +6,7 @@
6
6
  import { defineSlotRecipe } from "@pandacss/dev";
7
7
 
8
8
  /**
9
- * Card slot recipe Chakra's Card at its default md size (light mode), with
10
- * the `elevated` (default) and `outline` variants this app uses.
9
+ * Card slot recipe, with `elevated` (default) and `outline` variants.
11
10
  *
12
11
  * Registered in the base preset (base-preset.ts); `variant` is
13
12
  * forwarded as a runtime prop so the variants are generated via `staticCss`.
package/src/Card.tsx CHANGED
@@ -16,7 +16,8 @@ export interface CardProps
16
16
  }
17
17
 
18
18
  /**
19
- * Card — Chakra's <Card> equivalent (md size). Place a CardBody inside.
19
+ * Card — a container styled with the `card` config recipe (md size). Place a
20
+ * CardBody inside.
20
21
  */
21
22
  export const Card = forwardRef<HTMLDivElement, CardProps>(function Card(
22
23
  { variant, css: cssProp, className, ...rest },
@@ -6,10 +6,9 @@
6
6
  import { defineSlotRecipe } from "@pandacss/dev";
7
7
 
8
8
  /**
9
- * Checkbox slot recipe Chakra's checkbox with the default blue colorScheme
10
- * (light mode) and its sm/md/lg size scale. The control's
11
- * `borderColor: inherit` picks up a `borderColor` set on the root, matching
12
- * Chakra's convention for tinting the box from the call site.
9
+ * Checkbox slot recipe with an sm/md/lg size scale. The control's
10
+ * `borderColor: inherit` picks up a `borderColor` set on the root, so call
11
+ * sites can tint the box from there.
13
12
  *
14
13
  * State styling keys off data attributes stamped on the control by the
15
14
  * shared-ui Checkbox (react-aria provides the state via render props).
@@ -56,8 +55,8 @@ export const checkbox = defineSlotRecipe({
56
55
  borderColor: "controlCheckedHoverBg",
57
56
  },
58
57
  },
59
- // Chakra's disabled greys; the selected block restates _hover so the
60
- // widened native-:hover condition can't re-tint a disabled control.
58
+ // Disabled greys; the selected block restates _hover so the widened
59
+ // native-:hover condition can't re-tint a disabled control.
61
60
  "&[data-disabled]": {
62
61
  bg: "gray.100",
63
62
  borderColor: "gray.100",
@@ -83,9 +82,8 @@ export const checkbox = defineSlotRecipe({
83
82
  },
84
83
  },
85
84
  variants: {
86
- // Chakra's Checkbox size scale. The icon dimensions are Chakra's
87
- // 1.2em-wide check glyph at each size's icon fontSize (3xs/2xs/2xs),
88
- // resolved to rem.
85
+ // The icon dimensions are the 1.2em-wide check glyph at each size's icon
86
+ // fontSize (3xs/2xs/2xs), resolved to rem.
89
87
  size: {
90
88
  sm: {
91
89
  control: { width: "3", height: "3" },
package/src/Checkbox.tsx CHANGED
@@ -53,9 +53,8 @@ export interface CheckboxProps
53
53
  }
54
54
 
55
55
  /**
56
- * Checkbox — react-aria-components <Checkbox> styled like Chakra's checkbox.
57
- * Children render as the label; wrap them in a visually-hidden span for
58
- * icon-less checkboxes.
56
+ * Checkbox — a styled react-aria-components <Checkbox>. Children render as
57
+ * the label; wrap them in a visually-hidden span for icon-less checkboxes.
59
58
  */
60
59
  export const Checkbox = ({
61
60
  size,
@@ -16,8 +16,8 @@ export interface CheckboxGroupProps
16
16
  extends Omit<RACCheckboxGroupProps, "className" | "style">,
17
17
  FieldSupportProps {
18
18
  /**
19
- * Visible label for the group (Chakra's FormLabel above it). Use
20
- * `aria-label` instead where the design has none.
19
+ * Visible label for the group. Use `aria-label` instead where the design
20
+ * has none.
21
21
  */
22
22
  label?: ReactNode;
23
23
  /** Label style overrides. */
@@ -30,11 +30,9 @@ export interface CheckboxGroupProps
30
30
  /**
31
31
  * CheckboxGroup — react-aria-components <CheckboxGroup> for a set of
32
32
  * Checkboxes sharing one value array (each Checkbox's `value` marks its
33
- * entry). Beyond the optional field chrome (label/helperText/errorMessage
34
- * Chakra's FormControl parts) it carries no styling of its own: compose with
35
- * Stack for layout, as RadioGroup does. Chakra's CheckboxGroup was a bare
36
- * context provider, so ported call sites gain the chrome rather than
37
- * restating it around the group.
33
+ * entry). Beyond the optional field chrome (label/helperText/errorMessage)
34
+ * it carries no styling of its own: compose with Stack for layout, as
35
+ * RadioGroup does.
38
36
  */
39
37
  export const CheckboxGroup = ({
40
38
  label,
@@ -10,7 +10,7 @@ import { CloseIcon } from "./CloseIcon";
10
10
 
11
11
  export interface CloseButtonProps
12
12
  extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className"> {
13
- /** Chakra CloseButton sizes: sm 24px box, md 32px (default). */
13
+ /** sm is a 24px box, md 32px (default). */
14
14
  size?: "sm" | "md";
15
15
  /**
16
16
  * Grow the touch target 8px beyond the visible button on every side via an
@@ -24,7 +24,7 @@ export interface CloseButtonProps
24
24
  }
25
25
 
26
26
  /**
27
- * CloseButton — Chakra's standalone X button. A plain button (not react-aria)
27
+ * CloseButton — a standalone X button. A plain button (not react-aria)
28
28
  * so call sites can extend the hit area with pseudo-elements, which
29
29
  * react-aria's press bounding-rect check would defeat.
30
30
  */
package/src/CloseIcon.tsx CHANGED
@@ -12,10 +12,12 @@ export interface CloseIconProps {
12
12
  }
13
13
 
14
14
  /**
15
- * CloseIcon — the "✕" glyph used on close buttons (dialogs, toasts). This is
16
- * Chakra's exact CloseButton path so the visual matches; sized to `1em` and
17
- * `fill: currentColor` like the other icons. Reused wherever a close control
18
- * is needed.
15
+ * CloseIcon — the "✕" glyph used on close buttons (dialogs, toasts). Sized to
16
+ * `1em` and `fill: currentColor` like the other icons. Reused wherever a
17
+ * close control is needed.
18
+ *
19
+ * The path is Chakra UI's CloseButton icon, inlined for visual parity with
20
+ * the apps' original look (see the notice in LICENSE.md).
19
21
  */
20
22
  export const CloseIcon = ({ css: cssProp, className }: CloseIconProps) => (
21
23
  <svg
package/src/Code.tsx CHANGED
@@ -6,7 +6,7 @@
6
6
  import { styled } from "styled-system/jsx";
7
7
 
8
8
  /**
9
- * Code — inline code chip matching Chakra's <Code> (gray subtle, light mode).
9
+ * Code — an inline code chip (subtle grey, light mode).
10
10
  */
11
11
  export const Code = styled("code", {
12
12
  base: {
package/src/Collapse.tsx CHANGED
@@ -15,13 +15,13 @@ import { css, cx } from "styled-system/css";
15
15
  import { SystemStyleObject } from "styled-system/types";
16
16
 
17
17
  export interface CollapseProps {
18
- /** Expanded when true (Chakra's `in`). */
18
+ /** Expanded when true. */
19
19
  isOpen: boolean;
20
- /** Height when collapsed (Chakra's `startingHeight`). */
20
+ /** Height when collapsed. */
21
21
  startingHeight?: number | string;
22
22
  /**
23
- * Height when expanded (Chakra's `endingHeight`; defaults to the measured
24
- * content height, tracked with a ResizeObserver so nested expansion works).
23
+ * Height when expanded (defaults to the measured content height, tracked
24
+ * with a ResizeObserver so nested expansion works).
25
25
  */
26
26
  endingHeight?: number | string;
27
27
  /** Remove the content from the DOM once the exit transition finishes. */
@@ -36,15 +36,14 @@ const toCssSize = (v: number | string) =>
36
36
  typeof v === "number" ? `${v}px` : v;
37
37
 
38
38
  /**
39
- * Collapse — Chakra's Collapse transition without framer-motion: the content
40
- * is measured and the wrapper's height (and opacity, when collapsing to zero)
41
- * transitions between the collapsed and expanded sizes. Content stays mounted
42
- * unless `unmountOnExit` is set.
39
+ * Collapse — an expand/collapse transition: the content is measured and the
40
+ * wrapper's height (and opacity, when collapsing to zero) transitions between
41
+ * the collapsed and expanded sizes. Content stays mounted unless
42
+ * `unmountOnExit` is set.
43
43
  *
44
- * As with framer-motion, only `isOpen` changes animate: initial mounts render
45
- * at rest, and height corrections (late measurement, content growth) snap —
46
- * otherwise a collapse mounted inside an entering view morphs during the
47
- * outer animation.
44
+ * Only `isOpen` changes animate: initial mounts render at rest, and height
45
+ * corrections (late measurement, content growth) snap — otherwise a collapse
46
+ * mounted inside an entering view morphs during the outer animation.
48
47
  */
49
48
  export const Collapse = ({
50
49
  isOpen,
@@ -155,8 +154,8 @@ export const Collapse = ({
155
154
  height: displayOpen ? expanded : collapsed,
156
155
  opacity: displayOpen || !hideWhenCollapsed ? 1 : 0,
157
156
  // At rest fully-collapsed, remove the content from the a11y tree
158
- // and tab order, as Chakra did (kept visible while animating so
159
- // the exit transition shows).
157
+ // and tab order (kept visible while animating so the exit
158
+ // transition shows).
160
159
  visibility:
161
160
  displayOpen || animating || !hideWhenCollapsed ? undefined : "hidden",
162
161
  ...style,
package/src/Divider.tsx CHANGED
@@ -59,10 +59,10 @@ const StyledDivider = styled("hr", {
59
59
  export interface DividerProps extends ComponentProps<typeof StyledDivider> {}
60
60
 
61
61
  /**
62
- * Divider — a hairline rule matching Chakra's <Divider> (60% opacity; set
63
- * `borderColor` to tint, `thickness="thick"` for a 2px rule).
62
+ * Divider — a hairline rule (60% opacity; set `borderColor` to tint,
63
+ * `thickness="thick"` for a 2px rule).
64
64
  * `orientation="vertical"` needs a height from the layout, e.g. a stretched
65
- * flex row (Chakra's vertical divider likewise relied on `height: 100%`).
65
+ * flex row.
66
66
  *
67
67
  * Decorative by default: hidden from assistive tech, since a visual rule
68
68
  * between sections is noise as an announced separator (and every call site
@@ -6,12 +6,11 @@
6
6
  import { defineSlotRecipe } from "@pandacss/dev";
7
7
 
8
8
  /**
9
- * Drawer slot recipe — Chakra's default Drawer parts (light mode) at its
10
- * default `xs` size (20rem panel). Consumed by the shared-ui Drawer, which maps
11
- * the slots onto react-aria-components' ModalOverlay / Modal / Dialog.
9
+ * Drawer slot recipe — a 20rem (`xs`) side panel. Consumed by the shared-ui
10
+ * Drawer, which maps the slots onto react-aria-components' ModalOverlay /
11
+ * Modal / Dialog.
12
12
  *
13
- * The enter transition approximates Chakra's slide spring (damping 25,
14
- * stiffness 180) with a decelerating tween; exit matches its 0.15s ease-in-out
13
+ * The enter transition is a decelerating tween; the exit a 0.15s ease-in-out
15
14
  * tween.
16
15
  *
17
16
  * Registered in the base preset (base-preset.ts); `placement` is
package/src/Drawer.tsx CHANGED
@@ -24,7 +24,7 @@ export interface DrawerProps extends DrawerVariantProps {
24
24
  onClose: () => void;
25
25
  /**
26
26
  * Called after the drawer has fully closed (exit transition done and the
27
- * drawer removed). Matches Chakra's `onCloseComplete`.
27
+ * drawer removed).
28
28
  */
29
29
  onCloseComplete?: () => void;
30
30
  /** Allow closing by clicking the backdrop / pressing Escape (default true). */
@@ -39,9 +39,8 @@ export interface DrawerProps extends DrawerVariantProps {
39
39
  }
40
40
 
41
41
  /**
42
- * Drawer — a focus-trapping panel that slides in from the side. Collapses
43
- * Chakra's Drawer/DrawerOverlay/DrawerContent into a single shell; place
44
- * DrawerHeader and DrawerBody inside.
42
+ * Drawer — a focus-trapping panel that slides in from the side, in a single
43
+ * shell; place DrawerHeader and DrawerBody inside.
45
44
  */
46
45
  export const Drawer = ({
47
46
  isOpen,
package/src/Fade.tsx CHANGED
@@ -10,12 +10,9 @@ import { SystemStyleObject } from "styled-system/types";
10
10
  export interface FadeProps {
11
11
  /** Visible when true; faded out (but mounted) when false. */
12
12
  isOpen: boolean;
13
- /**
14
- * Fade-in time in seconds (Chakra's `transition.enter.duration`).
15
- * Default 0.2, Chakra's.
16
- */
13
+ /** Fade-in time in seconds. Default 0.2. */
17
14
  enterDuration?: number;
18
- /** Fade-out time in seconds (Chakra's `transition.exit.duration`). */
15
+ /** Fade-out time in seconds. Default 0.2. */
19
16
  exitDuration?: number;
20
17
  css?: SystemStyleObject;
21
18
  className?: string;
@@ -23,8 +20,8 @@ export interface FadeProps {
23
20
  }
24
21
 
25
22
  /**
26
- * Fade — Chakra's Fade transition as a CSS opacity transition (see Slide for
27
- * the pattern). Content stays mounted throughout.
23
+ * Fade — a CSS opacity transition (see Slide for the pattern). Content stays
24
+ * mounted throughout.
28
25
  */
29
26
  export const Fade = ({
30
27
  isOpen,
@@ -37,9 +34,8 @@ export const Fade = ({
37
34
  <div
38
35
  data-open={isOpen ? "" : undefined}
39
36
  // Runtime values, so an inline custom property rather than the css()
40
- // object (gotcha #9: a non-literal duration would extract to nothing).
41
- // The var switches in the same commit as the opacity, so the transition
42
- // picks up the direction's own duration.
37
+ // object. The var switches in the same commit as the opacity, so the
38
+ // transition picks up the direction's own duration.
43
39
  style={
44
40
  {
45
41
  "--fade-duration": `${isOpen ? enterDuration : exitDuration}s`,
@@ -6,9 +6,9 @@
6
6
  import { defineSlotRecipe } from "@pandacss/dev";
7
7
 
8
8
  /**
9
- * Field slot recipe — Chakra's FormControl parts (FormLabel/FormHelperText/
10
- * FormErrorMessage, light mode), mapped onto react-aria-components'
11
- * Label/Text/FieldError by `FieldLabel` and `FieldSupport`. Every labelled
9
+ * Field slot recipe — the label/helper/error chrome, mapped onto
10
+ * react-aria-components' Label/Text/FieldError by `FieldLabel` and
11
+ * `FieldSupport`. Every labelled
12
12
  * field in the library draws its chrome from here, including Select and
13
13
  * ComboBox, whose own recipe styles only the dropdown pair; the input itself is
14
14
  * styled by the `input` recipe (Input.recipe.ts).
@@ -35,10 +35,9 @@ export const field = defineSlotRecipe({
35
35
  label: {
36
36
  display: "block",
37
37
  fontSize: "md",
38
- // Deliberately not Chakra FormLabel's `medium`: no font in the family's
39
- // stack has a 500 face, so the two were pixel-identical on macOS and
40
- // Windows, and the only call sites that cared overrode to `normal`
41
- // (settings rows). See the playbook's expected behavioural deltas.
38
+ // Deliberately `normal`, not `medium`: no font in the family's stack
39
+ // has a 500 face (the two render identically on macOS and Windows),
40
+ // and the call sites that cared (settings rows) want `normal`.
42
41
  fontWeight: "normal",
43
42
  marginEnd: "3",
44
43
  mb: "2",
@@ -46,7 +45,7 @@ export const field = defineSlotRecipe({
46
45
  transitionDuration: "normal",
47
46
  // RAC stamps `data-disabled` on the field root and on the control, never
48
47
  // on the label, so an `&[data-disabled]` rule here matches nothing — it
49
- // has to come down from the root (gotcha #45). Direct child rather than a
48
+ // has to come down from the root. Direct child rather than a
50
49
  // descendant selector, as the select recipe's invalid rule: an app's own
51
50
  // disabled form wrapper must not be able to dim every label inside it.
52
51
  "[data-disabled] > &": { opacity: 0.4 },
@@ -58,7 +57,7 @@ export const field = defineSlotRecipe({
58
57
  helperText: {
59
58
  // RAC's Text renders a span, and RadioGroup/CheckboxGroup roots are not
60
59
  // flex containers to blockify it, where an inline box would drop the
61
- // margin below (gotcha #44).
60
+ // margin below.
62
61
  display: "block",
63
62
  mt: "2",
64
63
  fontSize: "sm",
@@ -77,9 +76,7 @@ export const field = defineSlotRecipe({
77
76
  variants: {
78
77
  // The label follows its control's size (the control itself is sized by
79
78
  // the `input`/`select` recipes), so one `size` prop scales the whole row.
80
- // Chakra's FormLabel never scaled a deliberate delta; see the playbook's
81
- // field-chrome notes. Helper and error text stay `sm` at every size, as
82
- // Chakra's did.
79
+ // Helper and error text stay `sm` at every size.
83
80
  size: {
84
81
  lg: { label: { fontSize: "lg" } },
85
82
  md: { label: { fontSize: "md" } },
package/src/Field.tsx CHANGED
@@ -15,15 +15,15 @@ import { field, FieldVariantProps } from "styled-system/recipes";
15
15
  import { SystemStyleObject } from "styled-system/types";
16
16
 
17
17
  /**
18
- * The label/helper/error chrome every labelled form field shares — Chakra's
19
- * FormControl parts, generalised out of TextField so Select, ComboBox,
20
- * NumberField, RadioGroup and CheckboxGroup carry the same props
21
- * (data-microbit-org's forms attach helper and error text to all of these).
18
+ * The helper/error chrome every labelled form field shares — TextField,
19
+ * Select, ComboBox, NumberField, RadioGroup and CheckboxGroup carry the same
20
+ * props (data-microbit-org's forms attach helper and error text to all of
21
+ * these).
22
22
  */
23
23
  export interface FieldSupportProps {
24
- /** Help text below the field (Chakra's FormHelperText). */
24
+ /** Help text below the field. */
25
25
  helperText?: ReactNode;
26
- /** Shown below the field when invalid (Chakra's FormErrorMessage). */
26
+ /** Shown below the field when invalid. */
27
27
  errorMessage?: ReactNode;
28
28
  /** Per-instance style overrides for the helper text. */
29
29
  helperTextCss?: SystemStyleObject;
@@ -87,8 +87,8 @@ interface FieldTextProps extends HTMLAttributes<HTMLDivElement> {
87
87
  }
88
88
 
89
89
  /**
90
- * Context-free helper text (Chakra's FormHelperText) for a control react-aria
91
- * isn't wiring — a native select or a masked input. Inside a RAC field
90
+ * Context-free helper text for a control react-aria isn't wiring — a native
91
+ * select or a masked input. Inside a RAC field
92
92
  * container use `FieldSupport`, which wires `aria-describedby` and validation
93
93
  * for free; here the caller owns that wiring: give this an `id` and reference
94
94
  * it from the control's `aria-describedby` (as `NativeSelectField` does).
@@ -111,8 +111,8 @@ export const FieldHelperText = ({
111
111
  );
112
112
 
113
113
  /**
114
- * Context-free error message (Chakra's FormErrorMessage), the counterpart to
115
- * `FieldHelperText` — see its note on the wiring the caller owns. RAC's
114
+ * Context-free error message, the counterpart to `FieldHelperText` — see its
115
+ * note on the wiring the caller owns. RAC's
116
116
  * `FieldError` renders only while its field is invalid; here that decision is
117
117
  * the caller's too: render it conditionally.
118
118
  */
@@ -134,9 +134,9 @@ export const FieldErrorMessage = ({
134
134
  );
135
135
 
136
136
  /**
137
- * The required-field asterisk (Chakra's FormLabel indicator). Render inside
138
- * the field's label when `isRequired`; aria-hidden because react-aria already
139
- * announces requiredness from the input itself.
137
+ * The required-field asterisk. Render inside the field's label when
138
+ * `isRequired`; aria-hidden because react-aria already announces requiredness
139
+ * from the input itself.
140
140
  */
141
141
  export const FieldRequiredIndicator = () => (
142
142
  <span aria-hidden className={field().requiredIndicator}>
@@ -158,11 +158,9 @@ export interface FieldLabelProps
158
158
  }
159
159
 
160
160
  /**
161
- * A field's visible label (Chakra's FormLabel), asterisk included. Every
162
- * labelled field in the library renders its label through this, so the `field`
163
- * recipe is the single answer to what a label looks like — Select and ComboBox
164
- * previously carried a near-identical `label` slot on the `select` recipe,
165
- * which is how the two drifted.
161
+ * A field's visible label, asterisk included. Every labelled field in the
162
+ * library renders its label through this, so the `field` recipe is the single
163
+ * answer to what a label looks like.
166
164
  *
167
165
  * Also exported for app-side composites: inside a RAC field container the
168
166
  * association is automatic, and outside one (a masked or native input) pass
@@ -11,8 +11,7 @@ import { defineSlotRecipe } from "@pandacss/dev";
11
11
  * a listbox: the roving tab index moves through rows, and the controls inside
12
12
  * a row are reachable without leaving it).
13
13
  *
14
- * Chakra had no equivalent, so there is no Chakra look to match: the greys
15
- * here are the family's neutral list styling, and an app with a strong
14
+ * The greys here are the family's neutral list styling; an app with a strong
16
15
  * selection colour restates them (classroom's roster does).
17
16
  *
18
17
  * Registered in the base preset (base-preset.ts), which also has the
@@ -6,7 +6,7 @@
6
6
  import { defineRecipe } from "@pandacss/dev";
7
7
 
8
8
  /**
9
- * Heading recipe — Chakra's default Heading base + responsive sizes.
9
+ * Heading recipe — a bold heading-font base + responsive sizes.
10
10
  * A config recipe for the same reasons as `button` (see Button.recipe.ts);
11
11
  * the `marketing` variant is token-driven via the `display` font, so brands
12
12
  * only override tokens.
@@ -50,10 +50,10 @@ export const heading = defineRecipe({
50
50
  //
51
51
  // `fontSize` goes through a doubled selector because `size` sets it too,
52
52
  // responsively. Source order can't settle that: Panda hoists media
53
- // queries below the base rules (gotcha #31) and emits variant rules in
54
- // the order it meets them, so which of the two wins would depend on the
55
- // breakpoint and on what other call sites exist. Two classes beat one at
56
- // every width instead.
53
+ // queries below the base rules and emits variant rules in the order it
54
+ // meets them, so which of the two wins would depend on the breakpoint
55
+ // and on what other call sites exist. Two classes beat one at every
56
+ // width instead.
57
57
  label: {
58
58
  "&&": { fontSize: "4xl" },
59
59
  color: "headingAccent",
package/src/Heading.tsx CHANGED
@@ -7,8 +7,8 @@ import { styled } from "styled-system/jsx";
7
7
  import { heading } from "styled-system/recipes";
8
8
 
9
9
  /**
10
- * Heading — Chakra's <Heading> equivalent, backed by the `heading` config
11
- * recipe (so the private preset can add brand variants). Defaults to an <h2>;
12
- * pass `as` to change the element and `size` to pick the type scale.
10
+ * Heading — a heading backed by the `heading` config recipe (so the private
11
+ * preset can add brand variants). Defaults to an <h2>; pass `as` to change
12
+ * the element and `size` to pick the type scale.
13
13
  */
14
14
  export const Heading = styled("h2", heading);
package/src/Icon.tsx CHANGED
@@ -11,8 +11,7 @@ import { SystemStyleObject } from "styled-system/types";
11
11
  * Any component that renders an `<svg>` from svg props. Deliberately no
12
12
  * narrower than the props `Icon` actually passes, so it accepts both
13
13
  * react-icons' `IconType` and svgr components (`import X from "./x.svg?react"`,
14
- * which the apps use for their custom-path icons — Chakra's `<Icon as={…}>`
15
- * took either).
14
+ * which the apps use for their custom-path icons).
16
15
  */
17
16
  export type IconComponent = ComponentType<
18
17
  Pick<
@@ -32,10 +31,9 @@ export interface IconProps {
32
31
  }
33
32
 
34
33
  /**
35
- * Icon — renders a react-icons glyph inline at `1em`, matching Chakra's <Icon>
36
- * base styles. `fill: currentColor` means the glyph follows the surrounding
37
- * text colour (set `css={{ color: ... }}` to override), so it inherits colour
38
- * like Chakra's icons rather than defaulting to black.
34
+ * Icon — renders a react-icons glyph inline at `1em`. `fill: currentColor`
35
+ * means the glyph follows the surrounding text colour rather than defaulting
36
+ * to black (set `css={{ color: ... }}` to override).
39
37
  *
40
38
  * Unlabelled icons are treated as decorative and hidden from assistive tech;
41
39
  * a labelled icon gets `role="img"` (a bare svg aria-label is unreliably
@@ -57,11 +55,9 @@ export const Icon = ({
57
55
  lineHeight: "1em",
58
56
  flexShrink: 0,
59
57
  fill: "currentColor",
60
- // Chakra's Icon set this on the element itself, and an inline-block
61
- // icon sits ~3px off without it. Panda's preflight happens to set it
62
- // on every svg, which hid the omission in apps that had already
63
- // flipped — classroom measured the difference at its kill-switch,
64
- // where the preflight arrived and moved every icon back.
58
+ // Set on the element itself: an inline-block icon sits ~3px off
59
+ // without it. Don't rely on Panda's preflight happening to set it on
60
+ // every svg.
65
61
  verticalAlign: "middle",
66
62
  ...cssProp,
67
63
  }),
@@ -11,7 +11,7 @@ export interface IconButtonProps
11
11
  /** Icon-only buttons have no visible label, so this is required. */
12
12
  "aria-label": string;
13
13
  /**
14
- * Circular rather than the recipe's border-radius (Chakra's `isRound`).
14
+ * Circular rather than the recipe's border-radius.
15
15
  * Usually a visual no-op here: the 2rem `button` radius already renders
16
16
  * square icon buttons as circles. Kept for ported call sites and for
17
17
  * variants/overrides with a smaller radius (e.g. `unstyled`).
package/src/Image.tsx CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { styled } from "styled-system/jsx";
7
7
 
8
- /** Image — an <img> accepting Panda style props. Replaces Chakra's <Image>. */
8
+ /** Image — an <img> accepting Panda style props. */
9
9
  export const Image = styled("img", {
10
10
  base: { maxWidth: "100%" },
11
11
  });