@canonical/react-ds-global 0.10.0-experimental.8
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 +28 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/index.js +2 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/types/index.js +2 -0
- package/dist/esm/lib/types/index.js.map +1 -0
- package/dist/esm/lib/types/polymorphic.js +2 -0
- package/dist/esm/lib/types/polymorphic.js.map +1 -0
- package/dist/esm/storybook/decorators.js +16 -0
- package/dist/esm/storybook/decorators.js.map +1 -0
- package/dist/esm/ui/Badge/Badge.js +21 -0
- package/dist/esm/ui/Badge/Badge.js.map +1 -0
- package/dist/esm/ui/Badge/hooks/useBadge.js +23 -0
- package/dist/esm/ui/Badge/hooks/useBadge.js.map +1 -0
- package/dist/esm/ui/Badge/index.js +4 -0
- package/dist/esm/ui/Badge/index.js.map +1 -0
- package/dist/esm/ui/Badge/styles.css +21 -0
- package/dist/esm/ui/Badge/types.js +3 -0
- package/dist/esm/ui/Badge/types.js.map +1 -0
- package/dist/esm/ui/Button/Button.js +10 -0
- package/dist/esm/ui/Button/Button.js.map +1 -0
- package/dist/esm/ui/Button/index.js +2 -0
- package/dist/esm/ui/Button/index.js.map +1 -0
- package/dist/esm/ui/Button/styles.css +63 -0
- package/dist/esm/ui/Button/types.js +12 -0
- package/dist/esm/ui/Button/types.js.map +1 -0
- package/dist/esm/ui/Card/Card.js +16 -0
- package/dist/esm/ui/Card/Card.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/Image.js +14 -0
- package/dist/esm/ui/Card/common/Image/Image.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/index.js +2 -0
- package/dist/esm/ui/Card/common/Image/index.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/styles.css +7 -0
- package/dist/esm/ui/Card/common/Image/types.js +3 -0
- package/dist/esm/ui/Card/common/Image/types.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/Section.js +13 -0
- package/dist/esm/ui/Card/common/Section/Section.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/index.js +2 -0
- package/dist/esm/ui/Card/common/Section/index.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/styles.css +6 -0
- package/dist/esm/ui/Card/common/Section/types.js +3 -0
- package/dist/esm/ui/Card/common/Section/types.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/ThumbnailSection.js +14 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/ThumbnailSection.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/index.js +2 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/index.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/styles.css +11 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/types.js +3 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/types.js.map +1 -0
- package/dist/esm/ui/Card/common/index.js +4 -0
- package/dist/esm/ui/Card/common/index.js.map +1 -0
- package/dist/esm/ui/Card/index.js +3 -0
- package/dist/esm/ui/Card/index.js.map +1 -0
- package/dist/esm/ui/Card/styles.css +23 -0
- package/dist/esm/ui/Card/types.js +3 -0
- package/dist/esm/ui/Card/types.js.map +1 -0
- package/dist/esm/ui/Chip/Chip.js +15 -0
- package/dist/esm/ui/Chip/Chip.js.map +1 -0
- package/dist/esm/ui/Chip/index.js +4 -0
- package/dist/esm/ui/Chip/index.js.map +1 -0
- package/dist/esm/ui/Chip/styles.css +86 -0
- package/dist/esm/ui/Chip/types.js +2 -0
- package/dist/esm/ui/Chip/types.js.map +1 -0
- package/dist/esm/ui/Icon/Icon.js +15 -0
- package/dist/esm/ui/Icon/Icon.js.map +1 -0
- package/dist/esm/ui/Icon/index.js +4 -0
- package/dist/esm/ui/Icon/index.js.map +1 -0
- package/dist/esm/ui/Icon/styles.css +12 -0
- package/dist/esm/ui/Icon/types.js +3 -0
- package/dist/esm/ui/Icon/types.js.map +1 -0
- package/dist/esm/ui/Link/Link.js +15 -0
- package/dist/esm/ui/Link/Link.js.map +1 -0
- package/dist/esm/ui/Link/index.js +4 -0
- package/dist/esm/ui/Link/index.js.map +1 -0
- package/dist/esm/ui/Link/styles.css +25 -0
- package/dist/esm/ui/Link/types.js +3 -0
- package/dist/esm/ui/Link/types.js.map +1 -0
- package/dist/esm/ui/Rule/Rule.js +16 -0
- package/dist/esm/ui/Rule/Rule.js.map +1 -0
- package/dist/esm/ui/Rule/index.js +4 -0
- package/dist/esm/ui/Rule/index.js.map +1 -0
- package/dist/esm/ui/Rule/styles.css +16 -0
- package/dist/esm/ui/Rule/types.js +3 -0
- package/dist/esm/ui/Rule/types.js.map +1 -0
- package/dist/esm/ui/Section/Section.js +21 -0
- package/dist/esm/ui/Section/Section.js.map +1 -0
- package/dist/esm/ui/Section/constants.js +2 -0
- package/dist/esm/ui/Section/constants.js.map +1 -0
- package/dist/esm/ui/Section/index.js +4 -0
- package/dist/esm/ui/Section/index.js.map +1 -0
- package/dist/esm/ui/Section/styles.css +50 -0
- package/dist/esm/ui/Section/types.js +3 -0
- package/dist/esm/ui/Section/types.js.map +1 -0
- package/dist/esm/ui/SkipLink/SkipLink.js +20 -0
- package/dist/esm/ui/SkipLink/SkipLink.js.map +1 -0
- package/dist/esm/ui/SkipLink/index.js +4 -0
- package/dist/esm/ui/SkipLink/index.js.map +1 -0
- package/dist/esm/ui/SkipLink/styles.css +21 -0
- package/dist/esm/ui/SkipLink/types.js +3 -0
- package/dist/esm/ui/SkipLink/types.js.map +1 -0
- package/dist/esm/ui/Tooltip/Tooltip.js +18 -0
- package/dist/esm/ui/Tooltip/Tooltip.js.map +1 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/TooltipArea.js +40 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/TooltipArea.js.map +1 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/index.js +4 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/index.js.map +1 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/styles.css +13 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/types.js +2 -0
- package/dist/esm/ui/Tooltip/common/TooltipArea/types.js.map +1 -0
- package/dist/esm/ui/Tooltip/common/index.js +2 -0
- package/dist/esm/ui/Tooltip/common/index.js.map +1 -0
- package/dist/esm/ui/Tooltip/index.js +6 -0
- package/dist/esm/ui/Tooltip/index.js.map +1 -0
- package/dist/esm/ui/Tooltip/styles.css +122 -0
- package/dist/esm/ui/Tooltip/types.js +2 -0
- package/dist/esm/ui/Tooltip/types.js.map +1 -0
- package/dist/esm/ui/Tooltip/withTooltip.js +18 -0
- package/dist/esm/ui/Tooltip/withTooltip.js.map +1 -0
- package/dist/esm/ui/documentation/documentation/Layout/Layout.js +21 -0
- package/dist/esm/ui/documentation/documentation/Layout/Layout.js.map +1 -0
- package/dist/esm/ui/documentation/documentation/Layout/index.js +4 -0
- package/dist/esm/ui/documentation/documentation/Layout/index.js.map +1 -0
- package/dist/esm/ui/documentation/documentation/Layout/types.js +3 -0
- package/dist/esm/ui/documentation/documentation/Layout/types.js.map +1 -0
- package/dist/esm/ui/documentation/index.js +2 -0
- package/dist/esm/ui/documentation/index.js.map +1 -0
- package/dist/esm/ui/hooks/index.js +6 -0
- package/dist/esm/ui/hooks/index.js.map +1 -0
- package/dist/esm/ui/hooks/useDelayedToggle/index.js +3 -0
- package/dist/esm/ui/hooks/useDelayedToggle/index.js.map +1 -0
- package/dist/esm/ui/hooks/useDelayedToggle/types.js +2 -0
- package/dist/esm/ui/hooks/useDelayedToggle/types.js.map +1 -0
- package/dist/esm/ui/hooks/useDelayedToggle/useDelayedToggle.js +45 -0
- package/dist/esm/ui/hooks/useDelayedToggle/useDelayedToggle.js.map +1 -0
- package/dist/esm/ui/hooks/usePopup/index.js +3 -0
- package/dist/esm/ui/hooks/usePopup/index.js.map +1 -0
- package/dist/esm/ui/hooks/usePopup/types.js +2 -0
- package/dist/esm/ui/hooks/usePopup/types.js.map +1 -0
- package/dist/esm/ui/hooks/usePopup/usePopup.js +93 -0
- package/dist/esm/ui/hooks/usePopup/usePopup.js.map +1 -0
- package/dist/esm/ui/hooks/useResizeObserver/index.js +3 -0
- package/dist/esm/ui/hooks/useResizeObserver/index.js.map +1 -0
- package/dist/esm/ui/hooks/useResizeObserver/types.js +2 -0
- package/dist/esm/ui/hooks/useResizeObserver/types.js.map +1 -0
- package/dist/esm/ui/hooks/useResizeObserver/useResizeObserver.js +32 -0
- package/dist/esm/ui/hooks/useResizeObserver/useResizeObserver.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowDimensions/index.js +3 -0
- package/dist/esm/ui/hooks/useWindowDimensions/index.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowDimensions/types.js +2 -0
- package/dist/esm/ui/hooks/useWindowDimensions/types.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowDimensions/useWindowDimensions.js +47 -0
- package/dist/esm/ui/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowFitment/index.js +3 -0
- package/dist/esm/ui/hooks/useWindowFitment/index.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowFitment/types.js +2 -0
- package/dist/esm/ui/hooks/useWindowFitment/types.js.map +1 -0
- package/dist/esm/ui/hooks/useWindowFitment/useWindowFitment.js +221 -0
- package/dist/esm/ui/hooks/useWindowFitment/useWindowFitment.js.map +1 -0
- package/dist/esm/ui/index.js +11 -0
- package/dist/esm/ui/index.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/types/index.d.ts +2 -0
- package/dist/types/lib/types/index.d.ts.map +1 -0
- package/dist/types/lib/types/polymorphic.d.ts +24 -0
- package/dist/types/lib/types/polymorphic.d.ts.map +1 -0
- package/dist/types/storybook/decorators.d.ts +15 -0
- package/dist/types/storybook/decorators.d.ts.map +1 -0
- package/dist/types/ui/Badge/Badge.d.ts +11 -0
- package/dist/types/ui/Badge/Badge.d.ts.map +1 -0
- package/dist/types/ui/Badge/hooks/useBadge.d.ts +7 -0
- package/dist/types/ui/Badge/hooks/useBadge.d.ts.map +1 -0
- package/dist/types/ui/Badge/index.d.ts +3 -0
- package/dist/types/ui/Badge/index.d.ts.map +1 -0
- package/dist/types/ui/Badge/types.d.ts +42 -0
- package/dist/types/ui/Badge/types.d.ts.map +1 -0
- package/dist/types/ui/Button/Button.d.ts +6 -0
- package/dist/types/ui/Button/Button.d.ts.map +1 -0
- package/dist/types/ui/Button/index.d.ts +3 -0
- package/dist/types/ui/Button/index.d.ts.map +1 -0
- package/dist/types/ui/Button/types.d.ts +22 -0
- package/dist/types/ui/Button/types.d.ts.map +1 -0
- package/dist/types/ui/Card/Card.d.ts +24 -0
- package/dist/types/ui/Card/Card.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/Image.d.ts +14 -0
- package/dist/types/ui/Card/common/Image/Image.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/index.d.ts +3 -0
- package/dist/types/ui/Card/common/Image/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/types.d.ts +5 -0
- package/dist/types/ui/Card/common/Image/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/Section.d.ts +13 -0
- package/dist/types/ui/Card/common/Section/Section.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/index.d.ts +3 -0
- package/dist/types/ui/Card/common/Section/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/types.d.ts +6 -0
- package/dist/types/ui/Card/common/Section/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/ThumbnailSection.d.ts +13 -0
- package/dist/types/ui/Card/common/ThumbnailSection/ThumbnailSection.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/index.d.ts +3 -0
- package/dist/types/ui/Card/common/ThumbnailSection/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/types.d.ts +12 -0
- package/dist/types/ui/Card/common/ThumbnailSection/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/index.d.ts +4 -0
- package/dist/types/ui/Card/common/index.d.ts.map +1 -0
- package/dist/types/ui/Card/index.d.ts +3 -0
- package/dist/types/ui/Card/index.d.ts.map +1 -0
- package/dist/types/ui/Card/types.d.ts +10 -0
- package/dist/types/ui/Card/types.d.ts.map +1 -0
- package/dist/types/ui/Chip/Chip.d.ts +10 -0
- package/dist/types/ui/Chip/Chip.d.ts.map +1 -0
- package/dist/types/ui/Chip/index.d.ts +3 -0
- package/dist/types/ui/Chip/index.d.ts.map +1 -0
- package/dist/types/ui/Chip/types.d.ts +27 -0
- package/dist/types/ui/Chip/types.d.ts.map +1 -0
- package/dist/types/ui/Icon/Icon.d.ts +13 -0
- package/dist/types/ui/Icon/Icon.d.ts.map +1 -0
- package/dist/types/ui/Icon/index.d.ts +3 -0
- package/dist/types/ui/Icon/index.d.ts.map +1 -0
- package/dist/types/ui/Icon/types.d.ts +13 -0
- package/dist/types/ui/Icon/types.d.ts.map +1 -0
- package/dist/types/ui/Link/Link.d.ts +10 -0
- package/dist/types/ui/Link/Link.d.ts.map +1 -0
- package/dist/types/ui/Link/index.d.ts +3 -0
- package/dist/types/ui/Link/index.d.ts.map +1 -0
- package/dist/types/ui/Link/types.d.ts +13 -0
- package/dist/types/ui/Link/types.d.ts.map +1 -0
- package/dist/types/ui/Rule/Rule.d.ts +12 -0
- package/dist/types/ui/Rule/Rule.d.ts.map +1 -0
- package/dist/types/ui/Rule/index.d.ts +3 -0
- package/dist/types/ui/Rule/index.d.ts.map +1 -0
- package/dist/types/ui/Rule/types.d.ts +11 -0
- package/dist/types/ui/Rule/types.d.ts.map +1 -0
- package/dist/types/ui/Section/Section.d.ts +12 -0
- package/dist/types/ui/Section/Section.d.ts.map +1 -0
- package/dist/types/ui/Section/constants.d.ts +2 -0
- package/dist/types/ui/Section/constants.d.ts.map +1 -0
- package/dist/types/ui/Section/index.d.ts +3 -0
- package/dist/types/ui/Section/index.d.ts.map +1 -0
- package/dist/types/ui/Section/types.d.ts +22 -0
- package/dist/types/ui/Section/types.d.ts.map +1 -0
- package/dist/types/ui/SkipLink/SkipLink.d.ts +16 -0
- package/dist/types/ui/SkipLink/SkipLink.d.ts.map +1 -0
- package/dist/types/ui/SkipLink/index.d.ts +3 -0
- package/dist/types/ui/SkipLink/index.d.ts.map +1 -0
- package/dist/types/ui/SkipLink/types.d.ts +16 -0
- package/dist/types/ui/SkipLink/types.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/Tooltip.d.ts +12 -0
- package/dist/types/ui/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/TooltipArea.d.ts +10 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/index.d.ts +3 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/index.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/types.d.ts +35 -0
- package/dist/types/ui/Tooltip/common/TooltipArea/types.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/common/index.d.ts +2 -0
- package/dist/types/ui/Tooltip/common/index.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/index.d.ts +5 -0
- package/dist/types/ui/Tooltip/index.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/types.d.ts +16 -0
- package/dist/types/ui/Tooltip/types.d.ts.map +1 -0
- package/dist/types/ui/Tooltip/withTooltip.d.ts +11 -0
- package/dist/types/ui/Tooltip/withTooltip.d.ts.map +1 -0
- package/dist/types/ui/documentation/documentation/Layout/Layout.d.ts +10 -0
- package/dist/types/ui/documentation/documentation/Layout/Layout.d.ts.map +1 -0
- package/dist/types/ui/documentation/documentation/Layout/index.d.ts +3 -0
- package/dist/types/ui/documentation/documentation/Layout/index.d.ts.map +1 -0
- package/dist/types/ui/documentation/documentation/Layout/types.d.ts +8 -0
- package/dist/types/ui/documentation/documentation/Layout/types.d.ts.map +1 -0
- package/dist/types/ui/documentation/index.d.ts +2 -0
- package/dist/types/ui/documentation/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/index.d.ts +6 -0
- package/dist/types/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/useDelayedToggle/index.d.ts +3 -0
- package/dist/types/ui/hooks/useDelayedToggle/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/useDelayedToggle/types.d.ts +27 -0
- package/dist/types/ui/hooks/useDelayedToggle/types.d.ts.map +1 -0
- package/dist/types/ui/hooks/useDelayedToggle/useDelayedToggle.d.ts +13 -0
- package/dist/types/ui/hooks/useDelayedToggle/useDelayedToggle.d.ts.map +1 -0
- package/dist/types/ui/hooks/usePopup/index.d.ts +3 -0
- package/dist/types/ui/hooks/usePopup/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/usePopup/types.d.ts +65 -0
- package/dist/types/ui/hooks/usePopup/types.d.ts.map +1 -0
- package/dist/types/ui/hooks/usePopup/usePopup.d.ts +19 -0
- package/dist/types/ui/hooks/usePopup/usePopup.d.ts.map +1 -0
- package/dist/types/ui/hooks/useResizeObserver/index.d.ts +3 -0
- package/dist/types/ui/hooks/useResizeObserver/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/useResizeObserver/types.d.ts +7 -0
- package/dist/types/ui/hooks/useResizeObserver/types.d.ts.map +1 -0
- package/dist/types/ui/hooks/useResizeObserver/useResizeObserver.d.ts +8 -0
- package/dist/types/ui/hooks/useResizeObserver/useResizeObserver.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowDimensions/index.d.ts +3 -0
- package/dist/types/ui/hooks/useWindowDimensions/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowDimensions/types.d.ts +21 -0
- package/dist/types/ui/hooks/useWindowDimensions/types.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowDimensions/useWindowDimensions.d.ts +6 -0
- package/dist/types/ui/hooks/useWindowDimensions/useWindowDimensions.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowFitment/index.d.ts +3 -0
- package/dist/types/ui/hooks/useWindowFitment/index.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowFitment/types.d.ts +73 -0
- package/dist/types/ui/hooks/useWindowFitment/types.d.ts.map +1 -0
- package/dist/types/ui/hooks/useWindowFitment/useWindowFitment.d.ts +4 -0
- package/dist/types/ui/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +11 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Canonical Design System - React Core
|
|
2
|
+
|
|
3
|
+
This package provides the core React components and utilities for Canonical's Design System.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
Install the package in a React 19 project with `bun add @canonical/react-ds-core`.
|
|
8
|
+
|
|
9
|
+
Then, import components from the package and use them in your React components.
|
|
10
|
+
An example of a component using the `Button` component:
|
|
11
|
+
```tsx
|
|
12
|
+
// MyComponent.tsx
|
|
13
|
+
import { Button } from "@canonical/react-ds-core";
|
|
14
|
+
|
|
15
|
+
function MyComponent() {
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<Button
|
|
19
|
+
appearance={"positive"}
|
|
20
|
+
label={"Click me"}
|
|
21
|
+
onClick={() => alert("hello world!")}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default MyComponent;
|
|
28
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorphic.js","sourceRoot":"","sources":["../../../../src/lib/types/polymorphic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const rtl = () => (Story) => (_jsx("div", { dir: "rtl", children: _jsx(Story, {}) }));
|
|
3
|
+
export const grid = () => (Story) => (_jsx("div", { style: {
|
|
4
|
+
display: "grid",
|
|
5
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
|
|
6
|
+
gap: "1em",
|
|
7
|
+
}, children: _jsx(Story, {}) }));
|
|
8
|
+
/**
|
|
9
|
+
* Places the story before a `<main>` element. This is useful for stories that need to be placed before the rest of the page contents in reading order (such as a skip link).
|
|
10
|
+
* @param id - The id of the main element
|
|
11
|
+
* @param children - Content to be rendered inside the main element
|
|
12
|
+
* @TODO this is the first decorator that seems like it may deserve a complex props object, and thus a separate Type.
|
|
13
|
+
* Should the type be declared separately? Should this be a separate file? Should the decorator be simplified somehow?
|
|
14
|
+
*/
|
|
15
|
+
export const beforeMain = ({ id = "main", children }) => (Story) => (_jsxs(_Fragment, { children: [_jsx(Story, {}), _jsx("main", { id: id, tabIndex: -1, children: children })] }));
|
|
16
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/storybook/decorators.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,CAC/C,cAAK,GAAG,EAAC,KAAK,YACZ,KAAC,KAAK,KAAG,GACL,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,CAChD,cACE,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,mBAAmB,EAAE,sCAAsC;QAC3D,GAAG,EAAE,KAAK;KACX,YAED,KAAC,KAAK,KAAG,GACL,CACP,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAyC,EAAE,EAAE,CACrE,CAAC,KAAkB,EAAE,EAAE,CAAC,CACtB,8BACE,KAAC,KAAK,KAAG,EACT,eAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,YACvB,QAAQ,GACJ,IACN,CACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
import useBadge from "./hooks/useBadge.js";
|
|
4
|
+
const componentCssClassName = "ds badge";
|
|
5
|
+
/**
|
|
6
|
+
* description of the Badge component
|
|
7
|
+
* @returns {React.ReactElement} - Rendered Badge
|
|
8
|
+
* @implements syntax:core:component:badge:1.0.0
|
|
9
|
+
*/
|
|
10
|
+
const Badge = ({ value, className, severity, humanizeOptions, pluralizeOptions, ...props }) => {
|
|
11
|
+
const { displayValue, title } = useBadge({
|
|
12
|
+
value,
|
|
13
|
+
humanizeOptions,
|
|
14
|
+
pluralizeOptions,
|
|
15
|
+
});
|
|
16
|
+
return (_jsx("span", { title: title, className: [componentCssClassName, severity, className]
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.join(" "), ...props, children: displayValue }));
|
|
19
|
+
};
|
|
20
|
+
export default Badge;
|
|
21
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/ui/Badge/Badge.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AACtB,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,KAAK,EACL,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,GAAG,KAAK,EACG,EAAsB,EAAE;IACnC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;QACvC,KAAK;QACL,eAAe;QACf,gBAAgB;KACjB,CAAC,CAAC;IAEH,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,QAAQ,EAAE,SAAS,CAAC;aACpD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,YAER,YAAY,GACR,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { humanizeNumber, pluralize, } from "@canonical/utils";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
const DEFAULT_HUMANIZE_OPTIONS = {
|
|
4
|
+
overflowIndicator: "+",
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A hook to manage a Badge's internal state
|
|
8
|
+
*/
|
|
9
|
+
const useBadge = ({ value, humanizeOptions, pluralizeOptions, }) => {
|
|
10
|
+
// Badge values must be at least 0 to preserve their purpose as natural number indicators
|
|
11
|
+
const valueToUse = useMemo(() => Math.max(0, value), [value]);
|
|
12
|
+
const displayValue = useMemo(() => {
|
|
13
|
+
const options = { ...DEFAULT_HUMANIZE_OPTIONS, ...humanizeOptions };
|
|
14
|
+
return humanizeNumber(valueToUse, options).displayValue;
|
|
15
|
+
}, [valueToUse, humanizeOptions]);
|
|
16
|
+
const title = useMemo(() => `${displayValue} ${pluralize(valueToUse, pluralizeOptions)}`, [valueToUse, displayValue, pluralizeOptions]);
|
|
17
|
+
return useMemo(() => ({
|
|
18
|
+
displayValue,
|
|
19
|
+
title,
|
|
20
|
+
}), [displayValue, title]);
|
|
21
|
+
};
|
|
22
|
+
export default useBadge;
|
|
23
|
+
//# sourceMappingURL=useBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBadge.js","sourceRoot":"","sources":["../../../../../src/ui/Badge/hooks/useBadge.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,MAAM,wBAAwB,GAA0B;IACtD,iBAAiB,EAAE,GAAG;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,QAAQ,GAAG,CAAC,EAChB,KAAK,EACL,eAAe,EACf,gBAAgB,GACF,EAAkB,EAAE;IAClC,yFAAyF;IACzF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9D,MAAM,YAAY,GAAW,OAAO,CAAC,GAAG,EAAE;QACxC,MAAM,OAAO,GAAG,EAAE,GAAG,wBAAwB,EAAE,GAAG,eAAe,EAAE,CAAC;QAEpE,OAAO,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC;IAC1D,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;IAElC,MAAM,KAAK,GAAW,OAAO,CAC3B,GAAG,EAAE,CAAC,GAAG,YAAY,IAAI,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,EAClE,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAC7C,CAAC;IAEF,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,YAAY;QACZ,KAAK;KACN,CAAC,EACF,CAAC,YAAY,EAAE,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Badge/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Badge.css */
|
|
2
|
+
.ds.badge {
|
|
3
|
+
/** Pull the badge closer to the edge of a chip */
|
|
4
|
+
--badge-chip-margin-tweak: 0.15rem;
|
|
5
|
+
|
|
6
|
+
/* Base badge styles using tokens */
|
|
7
|
+
background-color: var(--modifier-color, var(--badge-color-background));
|
|
8
|
+
border-radius: var(--badge-border-radius);
|
|
9
|
+
box-sizing: content-box;
|
|
10
|
+
color: var(--modifier-color-text, var(--badge-color-text));
|
|
11
|
+
display: inline-block;
|
|
12
|
+
font-size: var(--badge-font-size);
|
|
13
|
+
font-weight: var(--badge-font-weight);
|
|
14
|
+
line-height: var(--badge-line-height);
|
|
15
|
+
margin-bottom: var(--badge-margin-bottom);
|
|
16
|
+
max-width: var(--badge-max-width);
|
|
17
|
+
min-width: var(--badge-min-width);
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
padding: var(--badge-padding-vertical) var(--badge-padding-horizontal);
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Badge/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
/** Buttons are clickable elements used to perform an action. */
|
|
4
|
+
const Button = ({ id, className, children, style, appearance, ...props }) => {
|
|
5
|
+
return (_jsx("button", { id: id, className: ["ds", "button", appearance, className]
|
|
6
|
+
.filter(Boolean)
|
|
7
|
+
.join(" "), style: style, "aria-label": props["aria-label"] || children?.toString(), ...props, children: children }));
|
|
8
|
+
};
|
|
9
|
+
export default Button;
|
|
10
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/ui/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,OAAO,CACL,iBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC;aAC/C,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,gBAIA,KAAK,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE,QAAQ,EAAE,KACnD,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* component styles */
|
|
2
|
+
|
|
3
|
+
/* component variables
|
|
4
|
+
--button-color-background: background color of the button
|
|
5
|
+
--button-color-background-hover: background color of the button on hover
|
|
6
|
+
--button-color-background-active: background color of the button on active
|
|
7
|
+
--button-color-text: text color of the button
|
|
8
|
+
--button-color-border: border color of the button
|
|
9
|
+
--button-color-border-hover: border color of the button on hover
|
|
10
|
+
--button-color-border-active: border color of the button on active
|
|
11
|
+
|
|
12
|
+
--button-margin-left: left margin of the button
|
|
13
|
+
--button-margin-bottom: bottom margin of the button
|
|
14
|
+
--button-padding-vertical: vertical padding of the button
|
|
15
|
+
--button-padding-horizontal: horizontal padding of the button
|
|
16
|
+
--button-border-width: border width of the button
|
|
17
|
+
--button-font-size: font size of the button
|
|
18
|
+
--button-font-weight: font weight of the button
|
|
19
|
+
--button-line-height: line height of the button
|
|
20
|
+
*/
|
|
21
|
+
.ds.button {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
|
|
25
|
+
color: var(--modifier-color-text, var(--button-color-text));
|
|
26
|
+
background-color: var(--modifier-color, var(--button-color-background));
|
|
27
|
+
border-color: var(--modifier-color-border, var(--button-color-border));
|
|
28
|
+
border-style: solid;
|
|
29
|
+
border-width: var(--button-border-width);
|
|
30
|
+
font-size: var(--button-font-size);
|
|
31
|
+
font-weight: var(--button-font-weight);
|
|
32
|
+
line-height: var(--button-line-height);
|
|
33
|
+
margin-block-end: var(--button-margin-bottom);
|
|
34
|
+
margin-inline-end: var(--button-margin-left);
|
|
35
|
+
padding-block: var(--button-padding-vertical);
|
|
36
|
+
padding-inline: var(--button-padding-horizontal);
|
|
37
|
+
|
|
38
|
+
text-align: left;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
|
|
41
|
+
/* component states */
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: var(
|
|
44
|
+
--modifier-color-hover,
|
|
45
|
+
var(--button-color-background-hover)
|
|
46
|
+
);
|
|
47
|
+
border-color: var(
|
|
48
|
+
--modifier-color-border-hover,
|
|
49
|
+
var(--button-color-border-hover)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active {
|
|
54
|
+
background-color: var(
|
|
55
|
+
--modifier-color-active,
|
|
56
|
+
var(--button-color-background-active)
|
|
57
|
+
);
|
|
58
|
+
border-color: var(
|
|
59
|
+
--modifier-color-border-active,
|
|
60
|
+
var(--button-color-border-active)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// TODO: this is how appearance could work as enum
|
|
2
|
+
//
|
|
3
|
+
// export enum ButtonAppearance {
|
|
4
|
+
// DEFAULT = "default",
|
|
5
|
+
// BASE = "base",
|
|
6
|
+
// POSITIVE = "positive",
|
|
7
|
+
// NEGATIVE = "negative",
|
|
8
|
+
// LINK = "link",
|
|
9
|
+
// }
|
|
10
|
+
//
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Button/types.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,iCAAiC;AACjC,yBAAyB;AACzB,mBAAmB;AACnB,2BAA2B;AAC3B,2BAA2B;AAC3B,mBAAmB;AACnB,IAAI;AACJ,EAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image, Section, ThumbnailSection } from "./common/index.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
const componentCssClassName = "ds card";
|
|
5
|
+
/**
|
|
6
|
+
* Card component
|
|
7
|
+
* @implements syntax:core:component:card:1.0.0
|
|
8
|
+
*/
|
|
9
|
+
const Card = ({ className, children, emphasis = "neutral", ...props }) => (_jsx("div", { className: [componentCssClassName, emphasis, className]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(" "), ...props, children: children }));
|
|
12
|
+
Card.ThumbnailSection = ThumbnailSection;
|
|
13
|
+
Card.Image = Image;
|
|
14
|
+
Card.Section = Section;
|
|
15
|
+
export default Card;
|
|
16
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../src/ui/Card/Card.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,SAAS,EACpB,GAAG,KAAK,EACE,EAAsB,EAAE,CAAC,CACnC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,QAAQ,EAAE,SAAS,CAAC;SACpD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAEvB,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds card-image";
|
|
4
|
+
/**
|
|
5
|
+
* Image component for Card
|
|
6
|
+
* Full-width image with content bleed (no padding)
|
|
7
|
+
* @returns {React.ReactElement} - Rendered Image
|
|
8
|
+
*/
|
|
9
|
+
const Image = ({ className, alt, ...props }) => {
|
|
10
|
+
return (_jsx("img", { className: [componentCssClassName, className].filter(Boolean).join(" "), alt: alt, ...props }));
|
|
11
|
+
};
|
|
12
|
+
Image.displayName = "Card.Image";
|
|
13
|
+
export default Image;
|
|
14
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/Image.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACG,EAAsB,EAAE;IACnC,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,YAAY,CAAC;AAEjC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds card-section";
|
|
4
|
+
/**
|
|
5
|
+
* Section component for Card
|
|
6
|
+
* @returns {React.ReactElement} - Rendered Section
|
|
7
|
+
*/
|
|
8
|
+
const Section = ({ children, className, ...props }) => {
|
|
9
|
+
return (_jsx("section", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: children }));
|
|
10
|
+
};
|
|
11
|
+
Section.displayName = "Card.Section";
|
|
12
|
+
export default Section;
|
|
13
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/Section.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACK,EAAsB,EAAE;IACrC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC;AAErC,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Section from "../Section/Section.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
const componentCssClassName = "ds card-thumbnail-section";
|
|
5
|
+
/**
|
|
6
|
+
* ThumbnailSection component for Card thumbnails
|
|
7
|
+
* Extends Section behavior with thumbnail image
|
|
8
|
+
*/
|
|
9
|
+
const ThumbnailSection = ({ className, imageProps, ...props }) => {
|
|
10
|
+
return (_jsx(Section, { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: _jsx("img", { alt: imageProps.alt, ...imageProps }) }));
|
|
11
|
+
};
|
|
12
|
+
ThumbnailSection.displayName = "Card.ThumbnailSection";
|
|
13
|
+
export default ThumbnailSection;
|
|
14
|
+
//# sourceMappingURL=ThumbnailSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailSection.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/ThumbnailSection.tsx"],"names":[],"mappings":";AAGA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAE1D;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,EACxB,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACc,EAAsB,EAAE;IAC9C,OAAO,CACL,KAAC,OAAO,IACN,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAGT,cAAK,GAAG,EAAE,UAAU,CAAC,GAAG,KAAM,UAAU,GAAI,GACpC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAEvD,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
|
|
3
|
+
.ds.card-thumbnail-section {
|
|
4
|
+
& > img {
|
|
5
|
+
max-height: var(--card-thumbnail-max-height);
|
|
6
|
+
|
|
7
|
+
/* TODO in Vanilla these are globally applied to all imgs, maybe we want to do that here as well */
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
height: auto;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/Card/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Card/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
|
|
3
|
+
.ds.card {
|
|
4
|
+
/* prevent overflow of child margins */
|
|
5
|
+
overflow: auto;
|
|
6
|
+
|
|
7
|
+
box-shadow: var(--modifier-box-shadow, var(--card-box-shadow));
|
|
8
|
+
color: var(--modifier-color-text, var(--card-color-text));
|
|
9
|
+
background-color: var(--modifier-color, var(--card-color-background));
|
|
10
|
+
border-width: var(--card-border-width);
|
|
11
|
+
border-style: var(--card-border-style);
|
|
12
|
+
border-color: var(--card-section-separator-color);
|
|
13
|
+
|
|
14
|
+
& .card-section,
|
|
15
|
+
& .card-image {
|
|
16
|
+
/* Last section doesn't need a border (the Card itself has a border) */
|
|
17
|
+
&:not(:last-child) {
|
|
18
|
+
border-bottom: var(--card-section-separator-border-width)
|
|
19
|
+
var(--card-section-separator-border-style)
|
|
20
|
+
var(--card-section-separator-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Card/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds chip";
|
|
4
|
+
/**
|
|
5
|
+
* description of the Chip component
|
|
6
|
+
* @returns {React.ReactElement} - Rendered Chip
|
|
7
|
+
*/
|
|
8
|
+
const Chip = ({ appearance = "neutral", lead, value, onClick, onDismiss, id, className, style, ...props }) => {
|
|
9
|
+
const Container = onClick ? "button" : "span";
|
|
10
|
+
return (_jsxs(Container, { id: id, style: style, className: [componentCssClassName, appearance, className]
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.join(" "), onClick: onClick, ...props, children: [lead && _jsx("span", { className: "lead", children: lead }), value && _jsx("span", { className: "value", children: value }), onDismiss && (_jsx("button", { type: "button", className: "dismiss", "aria-label": "Dismiss", onClick: () => onDismiss() }))] }));
|
|
13
|
+
};
|
|
14
|
+
export default Chip;
|
|
15
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sourceRoot":"","sources":["../../../../src/ui/Chip/Chip.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAGtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,UAAU,GAAG,SAAS,EACtB,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,EAAE,EACF,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACM,EAAsB,EAAE;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,CACL,MAAC,SAAS,IACR,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,UAAU,EAAE,SAAS,CAAC;aACtD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,OAAO,EAAE,OAAO,KACZ,KAAK,aAER,IAAI,IAAI,eAAM,SAAS,EAAC,MAAM,YAAE,IAAI,GAAQ,EAC5C,KAAK,IAAI,eAAM,SAAS,EAAC,OAAO,YAAE,KAAK,GAAQ,EAC/C,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,SAAS,gBACR,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAC1B,CACH,IACS,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Chip/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* @canonical/generator-canonical-ds 0.4.0-experimental.0 */
|
|
2
|
+
|
|
3
|
+
.ds.chip {
|
|
4
|
+
border-color: var(--modifier-color-border, var(--chip-color-border));
|
|
5
|
+
border-style: solid;
|
|
6
|
+
border-radius: var(--chip-border-radius);
|
|
7
|
+
border-width: var(--chip-border-width);
|
|
8
|
+
|
|
9
|
+
color: var(--modifier-color-text-tinted, var(--chip-color-text));
|
|
10
|
+
background-color: var(--modifier-color-tinted, var(--chip-color-background));
|
|
11
|
+
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: baseline;
|
|
14
|
+
|
|
15
|
+
user-select: none;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
|
|
18
|
+
font-size: var(--chip-font-size);
|
|
19
|
+
font-weight: var(--chip-font-weight);
|
|
20
|
+
line-height: var(--chip-line-height);
|
|
21
|
+
|
|
22
|
+
margin-block-end: var(--chip-margin-bottom);
|
|
23
|
+
margin-inline-end: var(--chip-margin-left);
|
|
24
|
+
padding-block: var(--chip-padding-vertical);
|
|
25
|
+
padding-inline: var(--chip-padding-horizontal);
|
|
26
|
+
|
|
27
|
+
& > .lead {
|
|
28
|
+
font-variant-caps: all-small-caps;
|
|
29
|
+
font-variant-numeric: oldstyle-nums;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& > .lead + .value::before {
|
|
33
|
+
content: ": ";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
& > .lead,
|
|
37
|
+
& > .value {
|
|
38
|
+
display: inline;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& > .dismiss {
|
|
44
|
+
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M13.041 1.898l1.06 1.06L9.062 8l5.04 5.042-1.06 1.06L8 9.062 2.96 14.1l-1.06-1.06L6.938 8 1.9 2.96l1.06-1.06 5.04 5.04z'/%3E%3C/svg%3E");
|
|
45
|
+
background-color: var(--chip-color-background);
|
|
46
|
+
align-self: center;
|
|
47
|
+
background-size: 0.75rem;
|
|
48
|
+
background-repeat: no-repeat;
|
|
49
|
+
background-position: center;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
margin-left: var(--spacing-horizontal-xsmall);
|
|
53
|
+
flex: 0 0 auto;
|
|
54
|
+
border-radius: 50%;
|
|
55
|
+
border-color: transparent;
|
|
56
|
+
height: var(--font-size-default);
|
|
57
|
+
width: var(--font-size-default);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:is(button) {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:hover:not(:has(.dismiss)),
|
|
65
|
+
& > .dismiss:hover {
|
|
66
|
+
background-color: var(
|
|
67
|
+
--modifier-color-tinted-hover,
|
|
68
|
+
var(--chip-color-background-hover)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:active:not(:has(.dismiss)),
|
|
73
|
+
& > .dismiss:active {
|
|
74
|
+
background-color: var(
|
|
75
|
+
--modifier-color-tinted-active,
|
|
76
|
+
var(--chip-color-background-active)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Context-specific styling for badges within chips */
|
|
81
|
+
& .ds.badge {
|
|
82
|
+
align-self: center;
|
|
83
|
+
margin-left: var(--spacing-horizontal-small);
|
|
84
|
+
margin-right: var(--badge-chip-margin-tweak);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Chip/types.ts"],"names":[],"mappings":""}
|