@salt-ds/lab 1.0.0-alpha.22 → 1.0.0-alpha.23
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/css/salt-lab.css
CHANGED
|
@@ -30,20 +30,15 @@ const PillNext = React.forwardRef(
|
|
|
30
30
|
});
|
|
31
31
|
const { tabIndex, ...restButtonProps } = buttonProps;
|
|
32
32
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
33
|
-
className: withBaseName(),
|
|
33
|
+
className: clsx__default["default"](withBaseName(), className),
|
|
34
34
|
children: [
|
|
35
35
|
/* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
36
36
|
"data-testid": "pill",
|
|
37
37
|
ref,
|
|
38
|
-
className: clsx__default["default"](
|
|
39
|
-
withBaseName("
|
|
40
|
-
withBaseName("
|
|
41
|
-
|
|
42
|
-
[withBaseName("active")]: active,
|
|
43
|
-
[withBaseName("disabled")]: disabled
|
|
44
|
-
},
|
|
45
|
-
className
|
|
46
|
-
),
|
|
38
|
+
className: clsx__default["default"](withBaseName("action"), withBaseName("clickable"), {
|
|
39
|
+
[withBaseName("active")]: active,
|
|
40
|
+
[withBaseName("disabled")]: disabled
|
|
41
|
+
}),
|
|
47
42
|
...restButtonProps,
|
|
48
43
|
...restProps,
|
|
49
44
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef, MouseEvent } from \"react\";\nimport clsx from \"clsx\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { Button, makePrefixer, useButton } from \"@salt-ds/core\";\nimport pillCss from \"./PillNext.css\";\nimport { CloseIcon } from \"@salt-ds/icons\";\n\nexport interface PillNextProps extends ComponentPropsWithoutRef<\"button\"> {\n /* If true the pill will be disabled */\n disabled?: boolean;\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /* Pass an element to render an icon descriptor on the left of the label */\n icon?: React.ReactNode;\n}\n\nconst withBaseName = makePrefixer(\"saltPillNext\");\n\nexport const PillNext = forwardRef<HTMLButtonElement, PillNextProps>(\n function PillNext(\n { children, className, icon, disabled, onClose, ...restProps },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-pill-next\",\n css: pillCss,\n window: targetWindow,\n });\n const { buttonProps, active } = useButton<HTMLButtonElement>({\n disabled,\n ...restProps,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { tabIndex, ...restButtonProps } = buttonProps;\n\n return (\n <div className={withBaseName()}>\n <button\n data-testid=\"pill\"\n ref={ref}\n className={clsx(
|
|
1
|
+
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef, MouseEvent } from \"react\";\nimport clsx from \"clsx\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { Button, makePrefixer, useButton } from \"@salt-ds/core\";\nimport pillCss from \"./PillNext.css\";\nimport { CloseIcon } from \"@salt-ds/icons\";\n\nexport interface PillNextProps extends ComponentPropsWithoutRef<\"button\"> {\n /* If true the pill will be disabled */\n disabled?: boolean;\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /* Pass an element to render an icon descriptor on the left of the label */\n icon?: React.ReactNode;\n}\n\nconst withBaseName = makePrefixer(\"saltPillNext\");\n\nexport const PillNext = forwardRef<HTMLButtonElement, PillNextProps>(\n function PillNext(\n { children, className, icon, disabled, onClose, ...restProps },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-pill-next\",\n css: pillCss,\n window: targetWindow,\n });\n const { buttonProps, active } = useButton<HTMLButtonElement>({\n disabled,\n ...restProps,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { tabIndex, ...restButtonProps } = buttonProps;\n\n return (\n <div className={clsx(withBaseName(), className)}>\n <button\n data-testid=\"pill\"\n ref={ref}\n className={clsx(withBaseName(\"action\"), withBaseName(\"clickable\"), {\n [withBaseName(\"active\")]: active,\n [withBaseName(\"disabled\")]: disabled,\n })}\n {...restButtonProps}\n {...restProps}\n >\n {icon}\n <span className={withBaseName(\"label\")}>{children}</span>\n </button>\n {onClose && (\n <Button\n data-testid=\"pill-close-button\"\n className={withBaseName(\"close-button\")}\n disabled={disabled}\n onClick={onClose}\n >\n <CloseIcon />\n </Button>\n )}\n </div>\n );\n }\n);\n"],"names":["makePrefixer","forwardRef","PillNext","useWindow","useComponentCssInjection","pillCss","useButton","jsxs","clsx","jsx","Button","CloseIcon"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAM,YAAA,GAAeA,kBAAa,cAAc,CAAA,CAAA;AAEzC,MAAM,QAAW,GAAAC,gBAAA;AAAA,EACtB,SAASC,SACP,CAAA,EAAE,QAAU,EAAA,SAAA,EAAW,MAAM,QAAU,EAAA,OAAA,EAAA,GAAY,SAAU,EAAA,EAC7D,GACA,EAAA;AACA,IAAA,MAAM,eAAeC,gBAAU,EAAA,CAAA;AAC/B,IAAyBC,+BAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,gBAAA;AAAA,MACR,GAAK,EAAAC,UAAA;AAAA,MACL,MAAQ,EAAA,YAAA;AAAA,KACT,CAAA,CAAA;AACD,IAAA,MAAM,EAAE,WAAA,EAAa,MAAO,EAAA,GAAIC,cAA6B,CAAA;AAAA,MAC3D,QAAA;AAAA,MACA,GAAG,SAAA;AAAA,KACJ,CAAA,CAAA;AAID,IAAM,MAAA,EAAE,QAAa,EAAA,GAAA,eAAA,EAAoB,GAAA,WAAA,CAAA;AAEzC,IAAA,uBACGC,eAAA,CAAA,KAAA,EAAA;AAAA,MAAI,SAAW,EAAAC,wBAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MAC5C,QAAA,EAAA;AAAA,wBAACD,eAAA,CAAA,QAAA,EAAA;AAAA,UACC,aAAY,EAAA,MAAA;AAAA,UACZ,GAAA;AAAA,UACA,WAAWC,wBAAK,CAAA,YAAA,CAAa,QAAQ,CAAG,EAAA,YAAA,CAAa,WAAW,CAAG,EAAA;AAAA,YACjE,CAAC,YAAa,CAAA,QAAQ,CAAI,GAAA,MAAA;AAAA,YAC1B,CAAC,YAAa,CAAA,UAAU,CAAI,GAAA,QAAA;AAAA,WAC7B,CAAA;AAAA,UACA,GAAG,eAAA;AAAA,UACH,GAAG,SAAA;AAAA,UAEH,QAAA,EAAA;AAAA,YAAA,IAAA;AAAA,4BACAC,cAAA,CAAA,MAAA,EAAA;AAAA,cAAK,SAAA,EAAW,aAAa,OAAO,CAAA;AAAA,cAAI,QAAA;AAAA,aAAS,CAAA;AAAA,WAAA;AAAA,SACpD,CAAA;AAAA,QACC,2BACEA,cAAA,CAAAC,WAAA,EAAA;AAAA,UACC,aAAY,EAAA,mBAAA;AAAA,UACZ,SAAA,EAAW,aAAa,cAAc,CAAA;AAAA,UACtC,QAAA;AAAA,UACA,OAAS,EAAA,OAAA;AAAA,UAET,yCAACC,eAAU,EAAA,EAAA,CAAA;AAAA,SACb,CAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -22,20 +22,15 @@ const PillNext = forwardRef(
|
|
|
22
22
|
});
|
|
23
23
|
const { tabIndex, ...restButtonProps } = buttonProps;
|
|
24
24
|
return /* @__PURE__ */ jsxs("div", {
|
|
25
|
-
className: withBaseName(),
|
|
25
|
+
className: clsx(withBaseName(), className),
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ jsxs("button", {
|
|
28
28
|
"data-testid": "pill",
|
|
29
29
|
ref,
|
|
30
|
-
className: clsx(
|
|
31
|
-
withBaseName("
|
|
32
|
-
withBaseName("
|
|
33
|
-
|
|
34
|
-
[withBaseName("active")]: active,
|
|
35
|
-
[withBaseName("disabled")]: disabled
|
|
36
|
-
},
|
|
37
|
-
className
|
|
38
|
-
),
|
|
30
|
+
className: clsx(withBaseName("action"), withBaseName("clickable"), {
|
|
31
|
+
[withBaseName("active")]: active,
|
|
32
|
+
[withBaseName("disabled")]: disabled
|
|
33
|
+
}),
|
|
39
34
|
...restButtonProps,
|
|
40
35
|
...restProps,
|
|
41
36
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef, MouseEvent } from \"react\";\nimport clsx from \"clsx\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { Button, makePrefixer, useButton } from \"@salt-ds/core\";\nimport pillCss from \"./PillNext.css\";\nimport { CloseIcon } from \"@salt-ds/icons\";\n\nexport interface PillNextProps extends ComponentPropsWithoutRef<\"button\"> {\n /* If true the pill will be disabled */\n disabled?: boolean;\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /* Pass an element to render an icon descriptor on the left of the label */\n icon?: React.ReactNode;\n}\n\nconst withBaseName = makePrefixer(\"saltPillNext\");\n\nexport const PillNext = forwardRef<HTMLButtonElement, PillNextProps>(\n function PillNext(\n { children, className, icon, disabled, onClose, ...restProps },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-pill-next\",\n css: pillCss,\n window: targetWindow,\n });\n const { buttonProps, active } = useButton<HTMLButtonElement>({\n disabled,\n ...restProps,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { tabIndex, ...restButtonProps } = buttonProps;\n\n return (\n <div className={withBaseName()}>\n <button\n data-testid=\"pill\"\n ref={ref}\n className={clsx(
|
|
1
|
+
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef, MouseEvent } from \"react\";\nimport clsx from \"clsx\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { Button, makePrefixer, useButton } from \"@salt-ds/core\";\nimport pillCss from \"./PillNext.css\";\nimport { CloseIcon } from \"@salt-ds/icons\";\n\nexport interface PillNextProps extends ComponentPropsWithoutRef<\"button\"> {\n /* If true the pill will be disabled */\n disabled?: boolean;\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /* Pass an element to render an icon descriptor on the left of the label */\n icon?: React.ReactNode;\n}\n\nconst withBaseName = makePrefixer(\"saltPillNext\");\n\nexport const PillNext = forwardRef<HTMLButtonElement, PillNextProps>(\n function PillNext(\n { children, className, icon, disabled, onClose, ...restProps },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-pill-next\",\n css: pillCss,\n window: targetWindow,\n });\n const { buttonProps, active } = useButton<HTMLButtonElement>({\n disabled,\n ...restProps,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { tabIndex, ...restButtonProps } = buttonProps;\n\n return (\n <div className={clsx(withBaseName(), className)}>\n <button\n data-testid=\"pill\"\n ref={ref}\n className={clsx(withBaseName(\"action\"), withBaseName(\"clickable\"), {\n [withBaseName(\"active\")]: active,\n [withBaseName(\"disabled\")]: disabled,\n })}\n {...restButtonProps}\n {...restProps}\n >\n {icon}\n <span className={withBaseName(\"label\")}>{children}</span>\n </button>\n {onClose && (\n <Button\n data-testid=\"pill-close-button\"\n className={withBaseName(\"close-button\")}\n disabled={disabled}\n onClick={onClose}\n >\n <CloseIcon />\n </Button>\n )}\n </div>\n );\n }\n);\n"],"names":["PillNext","pillCss"],"mappings":";;;;;;;;;AAgBA,MAAM,YAAA,GAAe,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D,CAAA;AAAA,QACC,2BACE,GAAA,CAAA,MAAA,EAAA;AAAA,UACC,aAAY,EAAA,mBAAA;AAAA,UACZ,SAAA,EAAW,aAAa,cAAc,CAAA;AAAA,UACtC,QAAA;AAAA,UACA,OAAS,EAAA,OAAA;AAAA,UAET,8BAAC,SAAU,EAAA,EAAA,CAAA;AAAA,SACb,CAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salt-ds/lab",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"react-window": "^1.8.6",
|
|
27
27
|
"rifm": "^0.12.0",
|
|
28
28
|
"tinycolor2": "^1.4.2",
|
|
29
|
-
"@salt-ds/core": "^1.
|
|
29
|
+
"@salt-ds/core": "^1.13.1",
|
|
30
30
|
"@salt-ds/window": "^0.1.1",
|
|
31
|
-
"@salt-ds/styles": "^0.
|
|
32
|
-
"@salt-ds/icons": "^1.
|
|
31
|
+
"@salt-ds/styles": "^0.2.0",
|
|
32
|
+
"@salt-ds/icons": "^1.8.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@types/react": ">=16.14.0",
|