@open-pioneer/chakra-snippets 4.9.0 → 4.10.0-dev.20261119090001
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/CHANGELOG.md +30 -18
- package/link-button.js.map +1 -1
- package/package.json +4 -4
- package/password-input.js +1 -3
- package/password-input.js.map +1 -1
- package/qr-code.js.map +1 -1
- package/toggle-tip.js +4 -1
- package/toggle-tip.js.map +1 -1
- package/toggle.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @open-pioneer/chakra-snippets
|
|
2
2
|
|
|
3
|
+
## 4.10.0-dev.20261119090001
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f5a1a71: Update Chakra to 3.38.0
|
|
8
|
+
- f5a1a71: Update snippets: the `toggle-tip` no longer hardcodes its `gutter` to 4. If custom positioning is passed, that positioning's gutter will be used instead.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 57b5b4f: Enable trusted publishing for this package.
|
|
13
|
+
- 93d2a9f: Update dependencies
|
|
14
|
+
|
|
3
15
|
## 4.9.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -34,20 +46,20 @@
|
|
|
34
46
|
### Patch Changes
|
|
35
47
|
|
|
36
48
|
- e6db101: Update to Chakra UI 3.35.0
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
- update to Chakra UI @ 3.35.0, Ark UI @ 5.36.2, Zag JS @ 1.40.0
|
|
50
|
+
- use TooltipProviderProps to override `openDelay` globally (instead of Tooltip snippet)
|
|
39
51
|
|
|
40
52
|
- 0ac098b: Fix keyboard focus when a button is sometimes surrounded with a tooltip and sometimes not.
|
|
41
53
|
Previously the button would lose focus when pressing the Enter key:
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
```tsx
|
|
56
|
+
<Tooltip
|
|
57
|
+
content={/* ... */}
|
|
58
|
+
disabled={expanded} // enabled/disabled based on dynamic condition
|
|
59
|
+
>
|
|
60
|
+
<Button onClick={toggleExpanded}>...</Button>
|
|
61
|
+
</Tooltip>
|
|
62
|
+
```
|
|
51
63
|
|
|
52
64
|
## 4.5.0
|
|
53
65
|
|
|
@@ -81,14 +93,14 @@
|
|
|
81
93
|
|
|
82
94
|
- 0c278f6: Update snippets.
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
New snippets:
|
|
97
|
+
- `carousel`
|
|
98
|
+
- `combobox`
|
|
99
|
+
- `tags-input`
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
Updated snippets:
|
|
102
|
+
- `toggle-tip`: Now accepts `contentProps` prop, `portalRef` can refer to `null`
|
|
103
|
+
- `tooltip`: `portalRef` can refer to `null`
|
|
92
104
|
|
|
93
105
|
- eb54023: Update chakra to 3.29.0
|
|
94
106
|
|
|
@@ -104,7 +116,7 @@
|
|
|
104
116
|
|
|
105
117
|
- b7a854d: Update dependencies
|
|
106
118
|
- 3881d08: - Update Chakra UI from 3.22.0 to 3.24.2
|
|
107
|
-
|
|
119
|
+
- Update to latest Chakra snippets
|
|
108
120
|
- adf277b: Update dependencies
|
|
109
121
|
|
|
110
122
|
## 4.0.0
|
package/link-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-button.js","sources":["link-button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLChakraProps, RecipeProps } from \"@chakra-ui/react\"\nimport { createRecipeContext } from \"@chakra-ui/react\"\n\nexport interface LinkButtonProps
|
|
1
|
+
{"version":3,"file":"link-button.js","sources":["link-button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLChakraProps, RecipeProps } from \"@chakra-ui/react\"\nimport { createRecipeContext } from \"@chakra-ui/react\"\n\nexport interface LinkButtonProps extends HTMLChakraProps<\n \"a\",\n RecipeProps<\"button\">\n> {}\n\nconst { withContext } = createRecipeContext({ key: \"button\" })\n\n// Replace \"a\" with your framework's link component\nexport const LinkButton = withContext<HTMLAnchorElement, LinkButtonProps>(\"a\")\n"],"names":[],"mappings":";;AAUA,MAAM,EAAE,WAAA,EAAY,GAAI,oBAAoB,EAAE,GAAA,EAAK,UAAU,CAAA;AAGtD,MAAM,UAAA,GAAa,YAAgD,GAAG;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/chakra-snippets",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.10.0-dev.20261119090001",
|
|
5
5
|
"description": "Contains snippets for Chakra UI.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"directory": "src/packages/chakra-snippets"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ark-ui/react": "^5.
|
|
18
|
-
"@chakra-ui/react": "^3.
|
|
19
|
-
"@open-pioneer/runtime": "4.
|
|
17
|
+
"@ark-ui/react": "^5.40.0",
|
|
18
|
+
"@chakra-ui/react": "^3.38.0",
|
|
19
|
+
"@open-pioneer/runtime": "4.10.0-dev.20261119090001",
|
|
20
20
|
"react": "^19.3.1",
|
|
21
21
|
"react-icons": "^5.7.0"
|
|
22
22
|
},
|
package/password-input.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useControllableState, InputGroup, Input, mergeRefs, IconButton, Stack, HStack, Box } from '@chakra-ui/react';
|
|
3
|
-
import { useIntl } from './_virtual/hooks.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { LuEyeOff, LuEye } from 'react-icons/lu';
|
|
6
5
|
|
|
@@ -49,7 +48,6 @@ const PasswordInput = React.forwardRef(function PasswordInput2(props, ref) {
|
|
|
49
48
|
});
|
|
50
49
|
const VisibilityTrigger = React.forwardRef(
|
|
51
50
|
function VisibilityTrigger2(props, ref) {
|
|
52
|
-
const intl = useIntl();
|
|
53
51
|
return /* @__PURE__ */ jsx(
|
|
54
52
|
IconButton,
|
|
55
53
|
{
|
|
@@ -60,7 +58,7 @@ const VisibilityTrigger = React.forwardRef(
|
|
|
60
58
|
size: "sm",
|
|
61
59
|
variant: "ghost",
|
|
62
60
|
height: "calc(100% - {spacing.2})",
|
|
63
|
-
"aria-label":
|
|
61
|
+
"aria-label": "Toggle password visibility",
|
|
64
62
|
...props
|
|
65
63
|
}
|
|
66
64
|
);
|
package/password-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input.js","sources":["password-input.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n ButtonProps,\n GroupProps,\n InputProps,\n StackProps,\n} from \"@chakra-ui/react\"\nimport {\n Box,\n HStack,\n IconButton,\n Input,\n InputGroup,\n Stack,\n mergeRefs,\n useControllableState,\n} from \"@chakra-ui/react\"\nimport
|
|
1
|
+
{"version":3,"file":"password-input.js","sources":["password-input.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n ButtonProps,\n GroupProps,\n InputProps,\n StackProps,\n} from \"@chakra-ui/react\"\nimport {\n Box,\n HStack,\n IconButton,\n Input,\n InputGroup,\n Stack,\n mergeRefs,\n useControllableState,\n} from \"@chakra-ui/react\"\nimport * as React from \"react\"\nimport { LuEye, LuEyeOff } from \"react-icons/lu\"\n\nexport interface PasswordVisibilityProps {\n /**\n * The default visibility state of the password input.\n */\n defaultVisible?: boolean\n /**\n * The controlled visibility state of the password input.\n */\n visible?: boolean\n /**\n * Callback invoked when the visibility state changes.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Custom icons for the visibility toggle button.\n */\n visibilityIcon?: { on: React.ReactNode; off: React.ReactNode }\n}\n\nexport interface PasswordInputProps\n extends InputProps, PasswordVisibilityProps {\n rootProps?: GroupProps\n}\n\nexport const PasswordInput = React.forwardRef<\n HTMLInputElement,\n PasswordInputProps\n>(function PasswordInput(props, ref) {\n const {\n rootProps,\n defaultVisible,\n visible: visibleProp,\n onVisibleChange,\n visibilityIcon = { on: <LuEye />, off: <LuEyeOff /> },\n ...rest\n } = props\n\n const [visible, setVisible] = useControllableState({\n value: visibleProp,\n defaultValue: defaultVisible || false,\n onChange: onVisibleChange,\n })\n\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n return (\n <InputGroup\n endElement={\n <VisibilityTrigger\n disabled={rest.disabled}\n onPointerDown={(e) => {\n if (rest.disabled) return\n if (e.button !== 0) return\n e.preventDefault()\n setVisible(!visible)\n }}\n >\n {visible ? visibilityIcon.off : visibilityIcon.on}\n </VisibilityTrigger>\n }\n {...rootProps}\n >\n <Input\n {...rest}\n ref={mergeRefs(ref, inputRef)}\n type={visible ? \"text\" : \"password\"}\n />\n </InputGroup>\n )\n})\n\nconst VisibilityTrigger = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function VisibilityTrigger(props, ref) {\n return (\n <IconButton\n tabIndex={-1}\n ref={ref}\n me=\"-2\"\n aspectRatio=\"square\"\n size=\"sm\"\n variant=\"ghost\"\n height=\"calc(100% - {spacing.2})\"\n aria-label=\"Toggle password visibility\"\n {...props}\n />\n )\n },\n)\n\ninterface PasswordStrengthMeterProps extends StackProps {\n max?: number\n value: number\n}\n\nexport const PasswordStrengthMeter = React.forwardRef<\n HTMLDivElement,\n PasswordStrengthMeterProps\n>(function PasswordStrengthMeter(props, ref) {\n const { max = 4, value, ...rest } = props\n\n const percent = (value / max) * 100\n const { label, colorPalette } = getColorPalette(percent)\n\n return (\n <Stack align=\"flex-end\" gap=\"1\" ref={ref} {...rest}>\n <HStack width=\"full\" {...rest}>\n {Array.from({ length: max }).map((_, index) => (\n <Box\n key={index}\n height=\"1\"\n flex=\"1\"\n rounded=\"sm\"\n data-selected={index < value ? \"\" : undefined}\n layerStyle=\"fill.subtle\"\n colorPalette=\"gray\"\n _selected={{\n colorPalette,\n layerStyle: \"fill.solid\",\n }}\n />\n ))}\n </HStack>\n {label && <HStack textStyle=\"xs\">{label}</HStack>}\n </Stack>\n )\n})\n\nfunction getColorPalette(percent: number) {\n switch (true) {\n case percent < 33:\n return { label: \"Low\", colorPalette: \"red\" }\n case percent < 66:\n return { label: \"Medium\", colorPalette: \"orange\" }\n default:\n return { label: \"High\", colorPalette: \"green\" }\n }\n}\n"],"names":["PasswordInput","VisibilityTrigger","PasswordStrengthMeter"],"mappings":";;;;;AA6CO,MAAM,gBAAgB,KAAA,CAAM,UAAA,CAGjC,SAASA,cAAAA,CAAc,OAAO,GAAA,EAAK;AACnC,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,cAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,eAAA;AAAA,IACA,cAAA,GAAiB,EAAE,EAAA,kBAAI,GAAA,CAAC,SAAM,CAAA,EAAI,GAAA,kBAAK,GAAA,CAAC,QAAA,EAAA,EAAS,CAAA,EAAG;AAAA,IACpD,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,oBAAA,CAAqB;AAAA,IACjD,KAAA,EAAO,WAAA;AAAA,IACP,cAAc,cAAA,IAAkB,KAAA;AAAA,IAChC,QAAA,EAAU;AAAA,GACX,CAAA;AAED,EAAA,MAAM,QAAA,GAAW,KAAA,CAAM,MAAA,CAAyB,IAAI,CAAA;AAEpD,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,UAAA,kBACE,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,UAAU,IAAA,CAAK,QAAA;AAAA,UACf,aAAA,EAAe,CAAC,CAAA,KAAM;AACpB,YAAA,IAAI,KA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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.js","sources":["qr-code.tsx"],"sourcesContent":["import { QrCode as ChakraQrCode } from \"@chakra-ui/react\"\nimport * as React from \"react\"\n\nexport interface QrCodeProps
|
|
1
|
+
{"version":3,"file":"qr-code.js","sources":["qr-code.tsx"],"sourcesContent":["import { QrCode as ChakraQrCode } from \"@chakra-ui/react\"\nimport * as React from \"react\"\n\nexport interface QrCodeProps extends Omit<\n ChakraQrCode.RootProps,\n \"fill\" | \"overlay\"\n> {\n fill?: string\n overlay?: React.ReactNode\n}\n\nexport const QrCode = React.forwardRef<HTMLDivElement, QrCodeProps>(\n function QrCode(props, ref) {\n const { children, fill, overlay, ...rest } = props\n return (\n <ChakraQrCode.Root ref={ref} {...rest}>\n <ChakraQrCode.Frame style={{ fill }}>\n <ChakraQrCode.Pattern />\n </ChakraQrCode.Frame>\n {overlay}\n {children && <ChakraQrCode.Overlay>{children}</ChakraQrCode.Overlay>}\n </ChakraQrCode.Root>\n )\n },\n)\n"],"names":["QrCode","ChakraQrCode"],"mappings":";;;;AAWO,MAAM,SAAS,KAAA,CAAM,UAAA;AAAA,EAC1B,SAASA,OAAAA,CAAO,KAAA,EAAO,GAAA,EAAK;AAC1B,IAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,OAAA,EAAS,GAAG,MAAK,GAAI,KAAA;AAC7C,IAAA,4BACGC,QAAA,CAAa,IAAA,EAAb,EAAkB,GAAA,EAAW,GAAG,IAAA,EAC/B,QAAA,EAAA;AAAA,sBAAA,GAAA,CAACA,QAAA,CAAa,KAAA,EAAb,EAAmB,KAAA,EAAO,EAAE,IAAA,EAAK,EAChC,QAAA,kBAAA,GAAA,CAACA,QAAA,CAAa,OAAA,EAAb,EAAqB,CAAA,EACxB,CAAA;AAAA,MACC,OAAA;AAAA,MACA,QAAA,oBAAY,GAAA,CAACA,QAAA,CAAa,OAAA,EAAb,EAAsB,QAAA,EAAS;AAAA,KAAA,EAC/C,CAAA;AAAA,EAEJ;AACF;;"}
|
package/toggle-tip.js
CHANGED
|
@@ -18,7 +18,10 @@ const ToggleTip = React.forwardRef(
|
|
|
18
18
|
Popover.Root,
|
|
19
19
|
{
|
|
20
20
|
...rest,
|
|
21
|
-
positioning: {
|
|
21
|
+
positioning: {
|
|
22
|
+
...rest.positioning,
|
|
23
|
+
gutter: rest.positioning?.gutter ?? 4
|
|
24
|
+
},
|
|
22
25
|
children: [
|
|
23
26
|
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children }),
|
|
24
27
|
/* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsxs(
|
package/toggle-tip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-tip.js","sources":["toggle-tip.tsx"],"sourcesContent":["import {\n Popover as ChakraPopover,\n IconButton,\n type IconButtonProps,\n Portal,\n} from \"@chakra-ui/react\"\nimport * as React from \"react\"\nimport { HiOutlineInformationCircle } from \"react-icons/hi\"\n\nexport interface ToggleTipProps extends ChakraPopover.RootProps {\n showArrow?: boolean\n portalled?: boolean\n portalRef?: React.RefObject<HTMLElement | null>\n content?: React.ReactNode\n contentProps?: ChakraPopover.ContentProps\n}\n\nexport const ToggleTip = React.forwardRef<HTMLDivElement, ToggleTipProps>(\n function ToggleTip(props, ref) {\n const {\n showArrow,\n children,\n portalled = true,\n content,\n contentProps,\n portalRef,\n ...rest\n } = props\n\n return (\n <ChakraPopover.Root\n {...rest}\n positioning={{
|
|
1
|
+
{"version":3,"file":"toggle-tip.js","sources":["toggle-tip.tsx"],"sourcesContent":["import {\n Popover as ChakraPopover,\n IconButton,\n type IconButtonProps,\n Portal,\n} from \"@chakra-ui/react\"\nimport * as React from \"react\"\nimport { HiOutlineInformationCircle } from \"react-icons/hi\"\n\nexport interface ToggleTipProps extends ChakraPopover.RootProps {\n showArrow?: boolean\n portalled?: boolean\n portalRef?: React.RefObject<HTMLElement | null>\n content?: React.ReactNode\n contentProps?: ChakraPopover.ContentProps\n}\n\nexport const ToggleTip = React.forwardRef<HTMLDivElement, ToggleTipProps>(\n function ToggleTip(props, ref) {\n const {\n showArrow,\n children,\n portalled = true,\n content,\n contentProps,\n portalRef,\n ...rest\n } = props\n\n return (\n <ChakraPopover.Root\n {...rest}\n positioning={{\n ...rest.positioning,\n gutter: rest.positioning?.gutter ?? 4,\n }}\n >\n <ChakraPopover.Trigger asChild>{children}</ChakraPopover.Trigger>\n <Portal disabled={!portalled} container={portalRef}>\n <ChakraPopover.Positioner>\n <ChakraPopover.Content\n width=\"auto\"\n px=\"2\"\n py=\"1\"\n textStyle=\"xs\"\n rounded=\"sm\"\n ref={ref}\n {...contentProps}\n >\n {showArrow && (\n <ChakraPopover.Arrow>\n <ChakraPopover.ArrowTip />\n </ChakraPopover.Arrow>\n )}\n {content}\n </ChakraPopover.Content>\n </ChakraPopover.Positioner>\n </Portal>\n </ChakraPopover.Root>\n )\n },\n)\n\nexport interface InfoTipProps extends Partial<ToggleTipProps> {\n buttonProps?: IconButtonProps | undefined\n}\n\nexport const InfoTip = React.forwardRef<HTMLDivElement, InfoTipProps>(\n function InfoTip(props, ref) {\n const { children, buttonProps, ...rest } = props\n return (\n <ToggleTip content={children} {...rest} ref={ref}>\n <IconButton\n variant=\"ghost\"\n aria-label=\"info\"\n size=\"2xs\"\n colorPalette=\"gray\"\n {...buttonProps}\n >\n <HiOutlineInformationCircle />\n </IconButton>\n </ToggleTip>\n )\n },\n)\n"],"names":["ToggleTip","ChakraPopover","InfoTip"],"mappings":";;;;;AAiBO,MAAM,YAAY,KAAA,CAAM,UAAA;AAAA,EAC7B,SAASA,UAAAA,CAAU,KAAA,EAAO,GAAA,EAAK;AAC7B,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA,GAAY,IAAA;AAAA,MACZ,OAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;A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,MAAM,GAAA,EACtC,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,YAAA,EAAW,MAAA;AAAA,QACX,IAAA,EAAK,KAAA;AAAA,QACL,YAAA,EAAa,MAAA;AAAA,QACZ,GAAG,WAAA;AAAA,QAEJ,8BAAC,0BAAA,EAAA,EAA2B;AAAA;AAAA,KAC9B,EACF,CAAA;AAAA,EAEJ;AACF;;"}
|
package/toggle.d.ts
CHANGED
|
@@ -24,5 +24,5 @@ declare const variantMap: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
-
export declare const ToggleIndicator: React.ForwardRefExoticComponent<ChakraToggle.IndicatorProps & React.RefAttributes<
|
|
27
|
+
export declare const ToggleIndicator: React.ForwardRefExoticComponent<ChakraToggle.IndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
28
28
|
export {};
|