@grantbii/design-system 1.0.80 → 1.0.81
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/core/molecules/Dropdown.d.ts +1 -1
- package/core/molecules/Dropdown.js +1 -1
- package/core/molecules/Dropdown.js.map +1 -1
- package/package.json +3 -3
- package/stories/molecules/Dropdown.stories.d.ts +1 -0
- package/stories/molecules/Dropdown.stories.js +8 -0
- package/stories/molecules/Dropdown.stories.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,5 +4,5 @@ type DropdownProps = {
|
|
|
4
4
|
options: Option[];
|
|
5
5
|
defaultLabel?: string;
|
|
6
6
|
} & DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
7
|
-
declare const Dropdown: ({ options, defaultLabel, ...selectProps }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Dropdown: ({ options, defaultLabel, defaultValue, ...selectProps }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default Dropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Select } from "../atoms";
|
|
3
|
-
const Dropdown = ({ options, defaultLabel, ...selectProps }) => (_jsxs(Select, { ...selectProps, children: [_jsx("option", { hidden: true, disabled: true,
|
|
3
|
+
const Dropdown = ({ options, defaultLabel, defaultValue = "", ...selectProps }) => (_jsxs(Select, { ...selectProps, defaultValue: defaultValue, children: [_jsx("option", { hidden: true, disabled: true, value: defaultValue, children: defaultLabel ? defaultLabel : "-" }), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }));
|
|
4
4
|
export default Dropdown;
|
|
5
5
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../core/molecules/Dropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWlC,MAAM,QAAQ,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../core/molecules/Dropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWlC,MAAM,QAAQ,GAAG,CAAC,EAChB,OAAO,EACP,YAAY,EACZ,YAAY,GAAG,EAAE,EACjB,GAAG,WAAW,EACA,EAAE,EAAE,CAAC,CACnB,MAAC,MAAM,OAAK,WAAW,EAAE,YAAY,EAAE,YAAY,aACjD,iBAAQ,MAAM,QAAC,QAAQ,QAAC,KAAK,EAAE,YAAY,YACxC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAC3B,EAER,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAA2B,KAAK,EAAE,MAAM,CAAC,KAAK,YAC3C,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,KAAK,CAEhB,CACV,CAAC,IACK,CACV,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import type { DetailedHTMLProps, SelectHTMLAttributes } from \"react\";\nimport { Select } from \"../atoms\";\nimport type { Option } from \"../foundations\";\n\ntype DropdownProps = {\n options: Option[];\n defaultLabel?: string;\n} & DetailedHTMLProps<\n SelectHTMLAttributes<HTMLSelectElement>,\n HTMLSelectElement\n>;\n\nconst Dropdown = ({\n options,\n defaultLabel,\n defaultValue = \"\",\n ...selectProps\n}: DropdownProps) => (\n <Select {...selectProps} defaultValue={defaultValue}>\n <option hidden disabled value={defaultValue}>\n {defaultLabel ? defaultLabel : \"-\"}\n </option>\n\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </Select>\n);\n\nexport default Dropdown;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantbii/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
4
4
|
"description": "Grantbii's Design System",
|
|
5
5
|
"homepage": "https://design.grantbii.com",
|
|
6
6
|
"repository": {
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"eslint-config-next": "15.5.2",
|
|
48
48
|
"eslint-plugin-storybook": "^9.1.3",
|
|
49
49
|
"husky": "^9.1.7",
|
|
50
|
-
"lint-staged": "^16.1.
|
|
50
|
+
"lint-staged": "^16.1.6",
|
|
51
51
|
"playwright": "^1.55.0",
|
|
52
52
|
"prettier": "^3.6.2",
|
|
53
|
-
"storybook": "^9.1.
|
|
53
|
+
"storybook": "^9.1.4",
|
|
54
54
|
"typescript": "^5.9.2",
|
|
55
55
|
"vitest": "^3.2.4"
|
|
56
56
|
},
|
|
@@ -17,10 +17,18 @@ export const BasicExample = {
|
|
|
17
17
|
options,
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
+
export const CustomDefaults = {
|
|
21
|
+
args: {
|
|
22
|
+
options,
|
|
23
|
+
defaultValue: "-",
|
|
24
|
+
defaultLabel: "Select your grant need",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
20
27
|
export const WithValidation = {
|
|
21
28
|
args: {
|
|
22
29
|
options,
|
|
23
30
|
required: true,
|
|
31
|
+
defaultLabel: "Select your grant need",
|
|
24
32
|
},
|
|
25
33
|
};
|
|
26
34
|
//# sourceMappingURL=Dropdown.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Dropdown.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAGtD,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,oBAAoB;IAC3B,S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AC,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,OAAO;KACR;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,OAAO;QACP,YAAY,EAAE,GAAG;QACjB,YAAY,EAAE,wBAAwB;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,OAAO;QACP,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,wBAAwB;KACvC;CACF,CAAC","sourcesContent":["import { Dropdown } from \"@/.\";\nimport { Need } from \"@grantbii/ui-base/filter/enums\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Dropdown> = {\n title: \"Molecules/Dropdown\",\n component: Dropdown,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst options = Object.values(Need)\n .filter((need) => need !== Need.UNKNOWN)\n .map((need) => ({ label: need, value: need }));\n\nexport const BasicExample: Story = {\n args: {\n options,\n },\n};\n\nexport const CustomDefaults: Story = {\n args: {\n options,\n defaultValue: \"-\",\n defaultLabel: \"Select your grant need\",\n },\n};\n\nexport const WithValidation: Story = {\n args: {\n options,\n required: true,\n defaultLabel: \"Select your grant need\",\n },\n};\n"]}
|