@open-pioneer/map-ui-components 1.4.0-dev.20260727093741 → 1.5.0-dev.20260910103330
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 +35 -19
- package/ToolButton.js.map +1 -1
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
# @open-pioneer/map-ui-components
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.5.0-dev.20260910103330
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f790fda: Update to Chakra 3.37.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 09ec7c7: Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.4.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
6
16
|
|
|
7
17
|
- c30396d: Update Chakra to 3.36.1
|
|
18
|
+
- d862003: Update to trails core-packages 4.7.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- c16a401: Migrated from eslint to oxlint and from prettier to oxfmt.
|
|
8
23
|
|
|
9
24
|
## 1.3.0
|
|
10
25
|
|
|
@@ -52,9 +67,10 @@
|
|
|
52
67
|
|
|
53
68
|
- 66179bc: Update to core-packages v4.0.0
|
|
54
69
|
- 738390e: **Breaking:** Rename `<ToolButton />` props for consistency with Chakra naming conventions:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
|
|
71
|
+
- `isLoading` (old) --> `loading` (new)
|
|
72
|
+
- `isActive` (old) --> `active` (new)
|
|
73
|
+
- `isDisabled` (old) --> `disabled` (new)
|
|
58
74
|
|
|
59
75
|
- 738390e: Update to Chakra v3
|
|
60
76
|
|
|
@@ -62,16 +78,16 @@
|
|
|
62
78
|
|
|
63
79
|
- 9376a74: Ensure that icons and other decorative elements are hidden from the screen reader using the `aria-hidden="true"` attribute.
|
|
64
80
|
|
|
65
|
-
|
|
81
|
+
The easiest way to do that is to wrap icons into chakra's `<Icon />` component, for example:
|
|
66
82
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
```tsx
|
|
84
|
+
import { Icon } from "@chakra-ui/react";
|
|
85
|
+
import { FiX } from "react-icons/fi";
|
|
70
86
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
<Icon>
|
|
88
|
+
<FiX />
|
|
89
|
+
</Icon>;
|
|
90
|
+
```
|
|
75
91
|
|
|
76
92
|
## 0.10.0
|
|
77
93
|
|
|
@@ -92,9 +108,9 @@
|
|
|
92
108
|
### Minor Changes
|
|
93
109
|
|
|
94
110
|
- 2fa8020: Update trails core package dependencies.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
112
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
113
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
98
114
|
|
|
99
115
|
### Patch Changes
|
|
100
116
|
|
|
@@ -126,11 +142,11 @@
|
|
|
126
142
|
- 2090e72: Initial release.
|
|
127
143
|
The purpose of this package is to develop UI components that are closely related to the map.
|
|
128
144
|
|
|
129
|
-
|
|
130
|
-
|
|
145
|
+
The package `@open-pioneer/react-utils` has been moved into the [core-packages repository](https://github.com/open-pioneer/trails-core-packages/tree/main/src/packages/react-utils).
|
|
146
|
+
Most contents of the package have been moved as well, if they can be used independently from the map.
|
|
131
147
|
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
The component `ToolButton` has been moved into _this_ package instead.
|
|
149
|
+
See also the [release notes](https://github.com/open-pioneer/trails-core-packages/releases/tag/%40open-pioneer%2Freact-utils%401.0.0) of `@open-pioneer/react-utils`.
|
|
134
150
|
|
|
135
151
|
### Patch Changes
|
|
136
152
|
|
package/ToolButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.js","sources":["ToolButton.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Button, ButtonProps, Icon, Toggle } from \"@chakra-ui/react\";\nimport { Tooltip, TooltipProps } from \"@open-pioneer/chakra-snippets/tooltip\";\nimport {\n CommonComponentProps,\n mergeChakraProps,\n useCommonComponentProps\n} from \"@open-pioneer/react-utils\";\nimport {
|
|
1
|
+
{"version":3,"file":"ToolButton.js","sources":["ToolButton.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Button, ButtonProps, Icon, Toggle } from \"@chakra-ui/react\";\nimport { Tooltip, TooltipProps } from \"@open-pioneer/chakra-snippets/tooltip\";\nimport {\n CommonComponentProps,\n mergeChakraProps,\n useCommonComponentProps,\n classNames\n} from \"@open-pioneer/react-utils\";\nimport {\n FC,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n RefAttributes,\n memo,\n useState\n} from \"react\";\n\n/**\n * Properties supported by {@link ToolButton}.\n */\nexport interface ToolButtonProps extends CommonComponentProps, RefAttributes<HTMLButtonElement> {\n /**\n * The label for the ToolButton.\n * This value services as the tooltip text and the aria-label.\n *\n * This property is required for a11y reasons because a ToolButton usually only displays an icon.\n */\n label: string;\n\n /**\n * The icon displayed by the button.\n *\n * NOTE: You can use raw icons here (e.g. svgs from react-icons).\n * The ToolButton will surround the icon with chakra's `<Icon />` component.\n * This will apply the `aria-hidden` attribute, among other things.\n */\n icon: ReactElement;\n\n /**\n * If `true`, the button will show a spinner.\n * Defaults to `false`.\n */\n loading?: boolean;\n\n /**\n * If `true`, indicates that the button is currently active with a different style.\n * Defaults to `undefined`.\n *\n * A value of `true` or `false` indicates that the button supports being active (i.e. pressed).\n * In that case the `aria-pressed` attribute will be configured automatically\n * (see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed).\n */\n active?: boolean;\n\n /**\n * If `true`, the button will be disabled.\n * Defaults to `false`.\n */\n disabled?: boolean;\n\n /**\n * The callback that will be called when the user clicks the button.\n */\n onClick?: MouseEventHandler<HTMLButtonElement> | undefined;\n\n /**\n * Additional properties for the `Tooltip` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n tooltipProps?: Partial<TooltipProps>;\n\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\n}\n\n/**\n * An button with a tooltip, used for tool buttons on a map.\n */\nexport const ToolButton: FC<ToolButtonProps> = memo(function ToolButton(props: ToolButtonProps) {\n const {\n label,\n icon,\n onClick: onClickProp,\n loading,\n disabled,\n active,\n tooltipProps,\n buttonProps = {},\n ref\n } = props;\n\n const {\n containerProps: { className: baseClassName, ...containerProps }\n } = useCommonComponentProps(\"tool-button\", props);\n\n const className = classNames(baseClassName, {\n \"tool-button--active\": active,\n \"tool-button--loading\": loading,\n \"tool-button--disabled\": disabled\n });\n\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const onClick = (e: MouseEvent<HTMLButtonElement>) => {\n // Immediately hide the tooltip. When the label switches in reaction to the click,\n // the tooltip would flicker briefly with the new label.\n setTooltipOpen(false);\n onClickProp?.(e);\n };\n\n const mergedButtonProps = mergeChakraProps<ButtonProps>(\n { className, onClick, \"aria-label\": label, padding: 0, disabled, loading },\n containerProps,\n buttonProps\n );\n let button = (\n <ButtonIgnoringAriaProps ref={ref} {...mergedButtonProps}>\n <Icon>{icon}</Icon>\n </ButtonIgnoringAriaProps>\n );\n if (active != null) {\n // Make sure that only \"pressable\" buttons receive the aria-pressed attribute.\n button = (\n <Toggle.Root pressed={active} asChild>\n {button}\n </Toggle.Root>\n );\n }\n\n return (\n <Tooltip\n content={label}\n openDelay={500}\n {...tooltipProps}\n /* don't allow overwrite because component would break */\n open={tooltipOpen}\n onOpenChange={(e) => setTooltipOpen(e.open)}\n >\n {button}\n </Tooltip>\n );\n});\n\n/**\n * The tooltip will automatically set 'aria-describedby' when it is being shown.\n * This is redundant because the aria-label already has the same content as the tooltip.\n * This component wraps chakra's button to ignore the *-by attributes.\n */\nconst ButtonIgnoringAriaProps = function ButtonIgnoringAriaProps(\n props: ButtonProps & { ref?: React.Ref<HTMLButtonElement> }\n) {\n const { \"aria-labelledby\": _label, \"aria-describedby\": _describedBy, ref, ...rest } = props;\n return <Button ref={ref} {...rest} />;\n};\n"],"names":["ToolButton","ButtonIgnoringAriaProps"],"mappings":";;;;;;AAuFO,MAAM,UAAA,GAAkC,IAAA,CAAK,SAASA,WAAAA,CAAW,KAAA,EAAwB;AAC5F,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,IAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAc,EAAC;AAAA,IACf;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM;AAAA,IACF,cAAA,EAAgB,EAAE,SAAA,EAAW,aAAA,EAAe,GAAG,cAAA;AAAe,GAClE,GAAI,uBAAA,CAAwB,aAAA,EAAe,KAAK,CAAA;AAEhD,EAAA,MAAM,SAAA,GAAY,WAAW,aAAA,EAAe;AAAA,IACxC,qBAAA,EAAuB,MAAA;AAAA,IACvB,sBAAA,EAAwB,OAAA;AAAA,IACxB,uBAAA,EAAyB;AAAA,GAC5B,CAAA;AAED,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,EAAA,MAAM,OAAA,GAAU,CAAC,CAAA,KAAqC;AAGlD,IAAA,cAAA,CAAe,KAAK,CAAA;AACpB,IAAA,WAAA,GAAc,CAAC,CAAA;AAAA,EACnB,CAAA;AAEA,EAAA,MAAM,iBAAA,GAAoB,gBAAA;AAAA,IACtB,EAAE,WAAW,OAAA,EAAS,YAAA,EAAc,OAAO,OAAA,EAAS,CAAA,EAAG,UAAU,OAAA,EAAQ;AAAA,IACzE,cAAA;AAAA,IACA;AAAA,GACJ;AACA,EAAA,IAAI,MAAA,uBACC,uBAAA,EAAA,EAAwB,GAAA,EAAW,GAAG,iBAAA,EACnC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAM,QAAA,EAAA,IAAA,EAAK,CAAA,EAChB,CAAA;AAEJ,EAAA,IAAI,UAAU,IAAA,EAAM;AAEhB,IAAA,MAAA,mBACI,GAAA,CAAC,OAAO,IAAA,EAAP,EAAY,SAAS,MAAA,EAAQ,OAAA,EAAO,MAChC,QAAA,EAAA,MAAA,EACL,CAAA;AAAA,EAER;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACG,OAAA,EAAS,KAAA;AAAA,MACT,SAAA,EAAW,GAAA;AAAA,MACV,GAAG,YAAA;AAAA,MAEJ,IAAA,EAAM,WAAA;AAAA,MACN,YAAA,EAAc,CAAC,CAAA,KAAM,cAAA,CAAe,EAAE,IAAI,CAAA;AAAA,MAEzC,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAC;AAOD,MAAM,uBAAA,GAA0B,SAASC,wBAAAA,CACrC,KAAA,EACF;AACE,EAAA,MAAM,EAAE,mBAAmB,MAAA,EAAQ,kBAAA,EAAoB,cAAc,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AACtF,EAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAO,GAAA,EAAW,GAAG,IAAA,EAAM,CAAA;AACvC,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/map-ui-components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0-dev.20260910103330",
|
|
5
5
|
"description": "Contains ui components that can used together with the map",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
"directory": "src/packages/map-ui-components"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@chakra-ui/react": "^3.
|
|
18
|
-
"@open-pioneer/
|
|
19
|
-
"react": "
|
|
20
|
-
"
|
|
17
|
+
"@chakra-ui/react": "^3.37.0",
|
|
18
|
+
"@open-pioneer/chakra-snippets": "4.8.0-dev.20260910101405",
|
|
19
|
+
"@open-pioneer/react-utils": "4.8.0-dev.20260910101405",
|
|
20
|
+
"react": "^19.2.8"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"directory": "dist",
|
|
24
|
+
"linkDirectory": false
|
|
21
25
|
},
|
|
22
26
|
"exports": {
|
|
23
27
|
"./package.json": "./package.json",
|