teachable-design-system 0.3.4 → 0.3.6
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/dist/assets/index.ts +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/types/assets/index.d.ts +1 -0
- package/dist/types/assets/index.d.ts.map +1 -1
- package/dist/types/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/index.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +2 -2
- package/src/components/Sidebar/Sidebar.tsx +7 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAGvD,wBAAgB,OAAO,CAAC,EAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAC,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAGvD,wBAAgB,OAAO,CAAC,EAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAC,EAAE,YAAY,2CAqCtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teachable-design-system",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"storybook": "storybook dev -p 6006",
|
|
22
22
|
"build-storybook": "storybook build",
|
|
23
|
-
"build": "rm -rf dist && rollup -c && node scripts/copy-assets.js
|
|
23
|
+
"build": "rm -rf dist && rollup -c && node scripts/copy-assets.js"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^18.0.0 || ^19.0.0",
|
package/src/assets/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./icons";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {DropdownProps} from "../../types/Dropdown.types";
|
|
3
3
|
import {StyledBox, StyledDropDown, StyledText, StyledLabel, StyledIcon, StyledOptions, StyledOption} from "./style";
|
|
4
|
-
import
|
|
4
|
+
import arrowDownIcon from '../../assets/icons/arrow-down.png';
|
|
5
5
|
|
|
6
6
|
export function Dropdown({size, options, onSelect, label, placeholder, width}: DropdownProps) {
|
|
7
7
|
const [open, setOpen] = React.useState(false);
|
|
@@ -39,7 +39,7 @@ export function Dropdown({size, options, onSelect, label, placeholder, width}: D
|
|
|
39
39
|
isOpen={open}
|
|
40
40
|
>{selected ?? placeholder}</StyledText>
|
|
41
41
|
<StyledIcon size={size}>
|
|
42
|
-
<img src={
|
|
42
|
+
<img src={arrowDownIcon} alt="dropdown icon" style={{width:'100%', height:'100%'}}/>
|
|
43
43
|
</StyledIcon>
|
|
44
44
|
</StyledBox>
|
|
45
45
|
</StyledDropDown>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from './style'
|
|
11
11
|
import { Button } from "../Button/Button";
|
|
12
12
|
import {SidebarProps} from "../../types/Sidebar.types";
|
|
13
|
-
import
|
|
13
|
+
import icon from "../../assets/icons/icon_size.png"
|
|
14
14
|
|
|
15
15
|
export function Sidebar({buttonStyle, description, title}: SidebarProps) {
|
|
16
16
|
|
|
@@ -29,10 +29,12 @@ export function Sidebar({buttonStyle, description, title}: SidebarProps) {
|
|
|
29
29
|
<StyledDescription>
|
|
30
30
|
{title.map((item, index) => (
|
|
31
31
|
<StyledDisclosure>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
<StyledTitle onClick={() => toggleSection(index)} style={{ cursor: 'pointer' }}>
|
|
33
|
+
<StyledIcon src={icon} alt="icon" isOpen={openSections[index]} />
|
|
34
|
+
{item}
|
|
35
|
+
</StyledTitle>
|
|
36
|
+
|
|
37
|
+
{openSections[index] && (
|
|
36
38
|
<StyledOpenContents>
|
|
37
39
|
{description[index].map((option, i) => (
|
|
38
40
|
<StyledOpenContentsText key={i}>{option}</StyledOpenContentsText>
|