@crystallize/design-system 1.2.2 → 1.2.3
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 +8 -0
- package/dist/index.css +16 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +443 -410
- package/dist/index.mjs +442 -409
- package/package.json +1 -1
- package/src/action-menu/action-menu.css +1 -1
- package/src/icon-button/IconButton.stories.tsx +7 -0
- package/src/icon-button/icon-button.css +8 -0
- package/src/icon-button/icon-button.tsx +7 -2
- package/src/iconography/add.tsx +30 -0
- package/src/iconography/index.ts +2 -0
- package/src/slider/slider.tsx +3 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.c-action-menu {
|
|
2
|
-
@apply flex h-8 w-8 rotate-0 cursor-pointer flex-col items-center justify-center gap-[2px] rounded-md border-none bg-transparent p-1 -outline-offset-1 transition;
|
|
2
|
+
@apply flex h-8 w-8 shrink-0 rotate-0 cursor-pointer flex-col items-center justify-center gap-[2px] rounded-md border-none bg-transparent p-1 -outline-offset-1 transition;
|
|
3
3
|
&-dot {
|
|
4
4
|
@apply h-[4px] w-[4px] rounded-full bg-gray;
|
|
5
5
|
}
|
|
@@ -6,6 +6,10 @@ import './icon-button.css';
|
|
|
6
6
|
type IconButtonStylesProps = VariantProps<typeof buttonStyles>;
|
|
7
7
|
const buttonStyles = cva(['c-icon-button'], {
|
|
8
8
|
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: '',
|
|
11
|
+
elevate: 'c-icon-button-elevate',
|
|
12
|
+
},
|
|
9
13
|
size: {
|
|
10
14
|
xxs: 'c-icon-button-xxs',
|
|
11
15
|
xs: 'c-icon-button-xs',
|
|
@@ -16,15 +20,16 @@ const buttonStyles = cva(['c-icon-button'], {
|
|
|
16
20
|
},
|
|
17
21
|
defaultVariants: {
|
|
18
22
|
size: 'sm',
|
|
23
|
+
variant: 'default',
|
|
19
24
|
},
|
|
20
25
|
});
|
|
21
26
|
|
|
22
27
|
export type IconButtonProps = ComponentPropsWithRef<'button'> & IconButtonStylesProps;
|
|
23
28
|
|
|
24
29
|
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
25
|
-
({ children, className, type = 'button', size, ...delegated }, ref) => {
|
|
30
|
+
({ children, className, type = 'button', size, variant, ...delegated }, ref) => {
|
|
26
31
|
return (
|
|
27
|
-
<button ref={ref} type={type} className={buttonStyles({ size, className })} {...delegated}>
|
|
32
|
+
<button ref={ref} type={type} className={buttonStyles({ size, variant, className })} {...delegated}>
|
|
28
33
|
{children}
|
|
29
34
|
</button>
|
|
30
35
|
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { forwardRef, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
type AddProps = SVGProps<SVGSVGElement>;
|
|
4
|
+
|
|
5
|
+
type AddRef = SVGSVGElement;
|
|
6
|
+
|
|
7
|
+
export const Add = forwardRef<AddRef, AddProps>((delegated, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
ref={ref}
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
width="22"
|
|
13
|
+
height="22"
|
|
14
|
+
viewBox="0 0 22 22"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
{...delegated}
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
fill="#528693"
|
|
20
|
+
d="M13.258 19.467c.005-.095-.045-3.832-.045-3.832v-2.157l-.05-.096.141-.13 5.963.028a.647.647 0 0 0 .407-.15.587.587 0 0 0 .202-.376l.005-.188.055-3.064a.576.576 0 0 0-.174-.521.6.6 0 0 0-.266-.155 1.606 1.606 0 0 0-.366-.028c-.055.01-.114.004-.194.01h-.646l-4.962.031a.188.188 0 0 1-.133-.032l-.055-.091v-.348l.05-5.612a.61.61 0 0 0-.16-.434.625.625 0 0 0-.316-.16c-.109-.009-.258-.004-.38-.004-.058-.005-2.166-.092-2.974-.12a.517.517 0 0 0-.42.165.567.567 0 0 0-.156.44l.004 2.336-.045 2.57.022 1.222a.151.151 0 0 1-.04.086.105.105 0 0 1-.079.033l-5.894-.05a.57.57 0 0 0-.517.25c-.095.202-.13.427-.101.648L2.06 12.59a.598.598 0 0 0 .178.453l.054.055a.573.573 0 0 0 .247.11c.086.016.172.022.26.018l2.68.037 3.287-.014a16.393 16.393 0 0 0-.046 2.005l.02.22c-.02.017-.02.274 0 3.384.006.077.007.155.004.232-.01.136.006.273.045.403.024.083.07.157.133.215.053.059.12.104.194.133.146.037.297.052.448.046.06-.005.119 0 .174 0l2.748.077c.2.022.4-.016.577-.11a.452.452 0 0 0 .194-.388Zm-.873-.278h-.12a52.435 52.435 0 0 0-1.019-.05l-1.527-.066-.092-.046a.18.18 0 0 1-.04-.168l.044-3.357.015-2.401a.678.678 0 0 0-.188-.535.651.651 0 0 0-.457-.194l-5.185.017-.695-.009-.114.05-.12-.118.005-2.474a.248.248 0 0 1 .037-.202l.073-.054 5.163.022H9.3a.194.194 0 0 0 .156-.064.189.189 0 0 0 .06-.151l.004-1.706.014-2.62.013-1.45.018-.582-.004-.088.055-.054a.239.239 0 0 1 .165-.055l2.487.055.092.01.065.064.022.077-.091 5.333-.002.797a.452.452 0 0 0 .457.457l5.479-.018h.165c.165-.008.33-.002.493.018.046.006.09.02.13.041.05.05.036.156.036.238l-.004.078-.032 1.898s-.005.178-.01.22a.567.567 0 0 0 .005.123.5.5 0 0 1 .005.114c-.028.11-.12.119-.28.114l-5.583-.013a.905.905 0 0 0-.59.114.6.6 0 0 0-.234.499l.02 2.743.113 3.023c0 .068-.007.135-.018.201a.165.165 0 0 1-.12.17v-.002Z"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
fill="#BFF6F8"
|
|
24
|
+
d="M12.384 19.19h-.119a52.478 52.478 0 0 0-1.02-.05l-1.527-.065-.092-.046a.18.18 0 0 1-.04-.169l.045-3.357.014-2.401a.678.678 0 0 0-.188-.535.651.651 0 0 0-.457-.194l-5.184.016-.695-.009-.114.05-.12-.118.005-2.474a.248.248 0 0 1 .037-.202l.073-.054 5.163.022H9.3a.194.194 0 0 0 .156-.064.189.189 0 0 0 .06-.151l.004-1.706.014-2.62.013-1.45.018-.582-.004-.088.055-.054a.239.239 0 0 1 .165-.055l2.487.055.092.01.065.064.022.077-.091 5.333-.002.797a.452.452 0 0 0 .457.457l5.479-.018h.165c.165-.008.33-.002.493.018.046.006.09.02.13.041.05.05.036.156.036.238l-.004.078-.032 1.898s-.005.178-.01.22a.567.567 0 0 0 .005.123.5.5 0 0 1 .005.114c-.028.11-.12.119-.28.114l-5.583-.013a.906.906 0 0 0-.59.114.6.6 0 0 0-.234.499l.02 2.743.113 3.023c0 .068-.007.135-.018.201a.166.166 0 0 1-.12.17Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
Add.displayName = 'AddIcon';
|
package/src/iconography/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Add } from './add';
|
|
1
2
|
import { Arrow } from './arrow';
|
|
2
3
|
import { Atom } from './atom';
|
|
3
4
|
import { Cancel } from './cancel';
|
|
@@ -28,6 +29,7 @@ import { Users } from './users';
|
|
|
28
29
|
import { Warning } from './warning';
|
|
29
30
|
|
|
30
31
|
export const Icon = {
|
|
32
|
+
Add,
|
|
31
33
|
Arrow,
|
|
32
34
|
Atom,
|
|
33
35
|
Cancel,
|
package/src/slider/slider.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import { cx } from 'class-variance-authority';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
5
|
import './slider.css';
|
|
@@ -7,9 +8,9 @@ type SliderProps = SliderPrimitive.SliderProps & {
|
|
|
7
8
|
transparentRange?: boolean;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
export const Slider = forwardRef<HTMLSpanElement, SliderProps>(({ transparentRange, ...delegated }, ref) => {
|
|
11
|
+
export const Slider = forwardRef<HTMLSpanElement, SliderProps>(({ className, transparentRange, ...delegated }, ref) => {
|
|
11
12
|
return (
|
|
12
|
-
<SliderPrimitive.Root className=
|
|
13
|
+
<SliderPrimitive.Root className={cx('c-slider-root', className)} ref={ref} {...delegated}>
|
|
13
14
|
<SliderPrimitive.Track className="c-slider-track">
|
|
14
15
|
<SliderPrimitive.Range className={`c-slider-range ${transparentRange ? 'c-slider-range-transparent' : ''}`} />
|
|
15
16
|
</SliderPrimitive.Track>
|