@open-pioneer/map-ui-components 0.9.0-dev.20250220091855 → 0.9.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/CHANGELOG.md +19 -15
- package/ToolButton.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
# @open-pioneer/map-ui-components
|
|
2
2
|
|
|
3
|
-
## 0.9.0
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- cb94c75: update dependencies
|
|
4
8
|
|
|
5
9
|
## 0.8.0
|
|
6
10
|
|
|
7
11
|
### Minor Changes
|
|
8
12
|
|
|
9
|
-
-
|
|
13
|
+
- 2fa8020: Update trails core package dependencies.
|
|
10
14
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
15
|
+
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
16
|
+
- Removes any obsolete references to `@chakra-ui/system`.
|
|
17
|
+
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
|
14
18
|
|
|
15
19
|
### Patch Changes
|
|
16
20
|
|
|
17
|
-
-
|
|
21
|
+
- 49f0207: Update trails core packages to version 2.4.0
|
|
18
22
|
|
|
19
23
|
## 0.7.0
|
|
20
24
|
|
|
21
25
|
### Minor Changes
|
|
22
26
|
|
|
23
|
-
-
|
|
27
|
+
- 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
|
|
24
28
|
|
|
25
29
|
### Patch Changes
|
|
26
30
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
+
- 310800c: Update core packages version.
|
|
32
|
+
- a8b3449: Switch to a new versioning strategy.
|
|
33
|
+
From now on, packages released by this repository share a common version number.
|
|
34
|
+
- 900eb11: Update dependencies.
|
|
31
35
|
|
|
32
36
|
## 0.1.1
|
|
33
37
|
|
|
34
38
|
### Patch Changes
|
|
35
39
|
|
|
36
|
-
-
|
|
40
|
+
- b152428: Update trails dependencies
|
|
37
41
|
|
|
38
42
|
## 0.1.0
|
|
39
43
|
|
|
40
44
|
### Minor Changes
|
|
41
45
|
|
|
42
|
-
-
|
|
43
|
-
|
|
46
|
+
- 2090e72: Initial release.
|
|
47
|
+
The purpose of this package is to develop UI components that are closely related to the map.
|
|
44
48
|
|
|
45
49
|
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).
|
|
46
50
|
Most contents of the package have been moved as well, if they can be used independently from the map.
|
|
@@ -50,4 +54,4 @@
|
|
|
50
54
|
|
|
51
55
|
### Patch Changes
|
|
52
56
|
|
|
53
|
-
-
|
|
57
|
+
- 28e092a: Update dependencies
|
package/ToolButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton.js","sources":["ToolButton.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Button, ButtonProps, Tooltip, TooltipProps } from \"@open-pioneer/chakra-integration\";\nimport {\n FC,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n RefAttributes,\n forwardRef,\n useState\n} from \"react\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport classNames from \"classnames\";\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 icon: ReactElement;\n\n /**\n * If `true`, the button will show a spinner.\n * Defaults to `false`.\n */\n isLoading?: 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 isActive?: boolean;\n\n /**\n * If `true`, the button will be disabled.\n * Defaults to `false`.\n */\n isDisabled?: 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> = forwardRef(function ToolButton(\n props: ToolButtonProps,\n ref\n) {\n const {\n label,\n icon,\n onClick: onClickProp,\n isLoading,\n isDisabled,\n isActive,\n tooltipProps,\n buttonProps\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\": isActive,\n \"tool-button--loading\": isLoading,\n \"tool-button--disabled\": isDisabled\n });\n const ariaPressed = typeof isActive === \"boolean\" ? (isActive ? \"true\" : \"false\") : undefined;\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 return (\n <Tooltip\n label={label}\n placement=\"auto\"\n openDelay={500}\n {...tooltipProps}\n /* don't allow overwrite because component would break */\n isOpen={tooltipOpen}\n onOpen={() => setTooltipOpen(true)}\n onClose={() => setTooltipOpen(false)}\n >\n <ButtonIgnoringAriaProps\n className={className}\n ref={ref}\n aria-label={label}\n leftIcon={icon}\n iconSpacing={0}\n padding={0}\n isDisabled={isDisabled}\n isLoading={isLoading}\n isActive={isActive}\n aria-pressed={ariaPressed}\n {...containerProps}\n {...buttonProps}\n /* don't allow overwrite because component would break */\n onClick={onClick}\n />\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 = forwardRef(function ButtonIgnoringAriaProps(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement>\n) {\n const { \"aria-labelledby\": _label, \"aria-describedby\": _describedBy, ...rest } = props;\n return <Button ref={ref} {...rest} />;\n});\n"],"names":["ToolButton","ButtonIgnoringAriaProps"],"mappings":";;;;;;AA6EO,MAAM,UAAkC,GAAA,UAAA,CAAW,SAASA,WAAAA,CAC/D,OACA,GACF,EAAA;AACE,EAAM,MAAA;AAAA,IACF,KAAA;AAAA,IACA,IAAA;AAAA,IACA,OAAS,EAAA,WAAA;AAAA,IACT,SAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA
|
|
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, Tooltip, TooltipProps } from \"@open-pioneer/chakra-integration\";\nimport {\n FC,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n RefAttributes,\n forwardRef,\n useState\n} from \"react\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport classNames from \"classnames\";\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 icon: ReactElement;\n\n /**\n * If `true`, the button will show a spinner.\n * Defaults to `false`.\n */\n isLoading?: 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 isActive?: boolean;\n\n /**\n * If `true`, the button will be disabled.\n * Defaults to `false`.\n */\n isDisabled?: 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> = forwardRef(function ToolButton(\n props: ToolButtonProps,\n ref\n) {\n const {\n label,\n icon,\n onClick: onClickProp,\n isLoading,\n isDisabled,\n isActive,\n tooltipProps,\n buttonProps\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\": isActive,\n \"tool-button--loading\": isLoading,\n \"tool-button--disabled\": isDisabled\n });\n const ariaPressed = typeof isActive === \"boolean\" ? (isActive ? \"true\" : \"false\") : undefined;\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 return (\n <Tooltip\n label={label}\n placement=\"auto\"\n openDelay={500}\n {...tooltipProps}\n /* don't allow overwrite because component would break */\n isOpen={tooltipOpen}\n onOpen={() => setTooltipOpen(true)}\n onClose={() => setTooltipOpen(false)}\n >\n <ButtonIgnoringAriaProps\n className={className}\n ref={ref}\n aria-label={label}\n leftIcon={icon}\n iconSpacing={0}\n padding={0}\n isDisabled={isDisabled}\n isLoading={isLoading}\n isActive={isActive}\n aria-pressed={ariaPressed}\n {...containerProps}\n {...buttonProps}\n /* don't allow overwrite because component would break */\n onClick={onClick}\n />\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 = forwardRef(function ButtonIgnoringAriaProps(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement>\n) {\n const { \"aria-labelledby\": _label, \"aria-describedby\": _describedBy, ...rest } = props;\n return <Button ref={ref} {...rest} />;\n});\n"],"names":["ToolButton","ButtonIgnoringAriaProps"],"mappings":";;;;;;AA6EO,MAAM,UAAkC,GAAA,UAAA,CAAW,SAASA,WAAAA,CAC/D,OACA,GACF,EAAA;AACE,EAAM,MAAA;AAAA,IACF,KAAA;AAAA,IACA,IAAA;AAAA,IACA,OAAS,EAAA,WAAA;AAAA,IACT,SAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACA,GAAA,KAAA;AAEJ,EAAM,MAAA;AAAA,IACF,cAAgB,EAAA,EAAE,SAAW,EAAA,aAAA,EAAe,GAAG,cAAe;AAAA,GAClE,GAAI,uBAAwB,CAAA,aAAA,EAAe,KAAK,CAAA;AAEhD,EAAM,MAAA,SAAA,GAAY,WAAW,aAAe,EAAA;AAAA,IACxC,qBAAuB,EAAA,QAAA;AAAA,IACvB,sBAAwB,EAAA,SAAA;AAAA,IACxB,uBAAyB,EAAA;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A,GAAG,IAAM,EAAA,CAAA;AACvC,CAAC,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": "0.9.0
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "Contains ui components that can used together with the map",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"directory": "src/packages/map-ui-components"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@open-pioneer/chakra-integration": "^
|
|
18
|
-
"@open-pioneer/react-utils": "^
|
|
17
|
+
"@open-pioneer/chakra-integration": "^3.0.0",
|
|
18
|
+
"@open-pioneer/react-utils": "^3.0.0",
|
|
19
19
|
"classnames": "^2.3.2",
|
|
20
|
-
"react": "^
|
|
20
|
+
"react": "^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
"exports": {
|
|
23
23
|
"./package.json": "./package.json",
|