lism-css 0.0.1 → 0.0.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/README.md +52 -0
- package/dist/_virtual/jsx-runtime.js +5 -0
- package/dist/_virtual/jsx-runtime2.js +4 -0
- package/dist/_virtual/react-jsx-runtime.development.js +4 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js +4 -0
- package/dist/components/Accordion/AccIcon.js +10 -0
- package/dist/components/Accordion/getProps.js +29 -0
- package/dist/components/Accordion/index.js +6 -0
- package/dist/components/Accordion/index2.js +32 -0
- package/dist/components/Accordion/setAccordion.js +37 -0
- package/dist/components/Accordion/style.css +1 -0
- package/dist/components/Box/getProps.js +7 -0
- package/dist/components/Box/index.js +9 -0
- package/dist/components/Center/index.js +8 -0
- package/dist/components/Columns/getProps.js +6 -0
- package/dist/components/Columns/index.js +9 -0
- package/dist/components/Container/index.js +9 -0
- package/dist/components/Decorator/getProps.js +15 -0
- package/dist/components/Decorator/index.js +9 -0
- package/dist/components/Divider/getProps.js +11 -0
- package/dist/components/Divider/index.js +9 -0
- package/dist/components/Dummy/getContent.js +9 -0
- package/dist/components/Dummy/index.js +17 -0
- package/dist/components/Dummy/texts.js +24 -0
- package/dist/components/Flex/Cluster.js +8 -0
- package/dist/components/Flex/FlexItem.js +9 -0
- package/dist/components/Flex/getProps.js +13 -0
- package/dist/components/Flex/index.js +9 -0
- package/dist/components/Frame/getProps.js +7 -0
- package/dist/components/Frame/index.js +9 -0
- package/dist/components/Grid/GridItem.js +10 -0
- package/dist/components/Grid/getProps.js +28 -0
- package/dist/components/Grid/index.js +9 -0
- package/dist/components/Icon/SVG.js +29 -0
- package/dist/components/Icon/getProps.js +34 -0
- package/dist/components/Icon/index.js +11 -0
- package/dist/components/Icon/presets.js +193 -0
- package/dist/components/Layer/getProps.js +9 -0
- package/dist/components/Layer/index.js +10 -0
- package/dist/components/LinkBox/index.js +9 -0
- package/dist/components/Lism/Link.js +8 -0
- package/dist/components/Lism/Media.js +10 -0
- package/dist/components/Lism/Text.js +8 -0
- package/dist/components/Lism/index.js +9 -0
- package/dist/components/Modal/Body.js +10 -0
- package/dist/components/Modal/CloseIconBtn.js +19 -0
- package/dist/components/Modal/Footer.js +10 -0
- package/dist/components/Modal/Header.js +10 -0
- package/dist/components/Modal/Inner.js +9 -0
- package/dist/components/Modal/getProps.js +19 -0
- package/dist/components/Modal/index.js +10 -0
- package/dist/components/Modal/index2.js +17 -0
- package/dist/components/Modal/setModal.js +37 -0
- package/dist/components/Modal/style.css +1 -0
- package/dist/components/Spacer/getProps.js +21 -0
- package/dist/components/Spacer/index.js +9 -0
- package/dist/components/Stack/index.js +8 -0
- package/dist/components/Tabs/Tab.js +22 -0
- package/dist/components/Tabs/TabItem.js +7 -0
- package/dist/components/Tabs/TabList.js +8 -0
- package/dist/components/Tabs/TabPanel.js +19 -0
- package/dist/components/Tabs/getProps.js +17 -0
- package/dist/components/Tabs/index.js +9 -0
- package/dist/components/Tabs/index2.js +55 -0
- package/dist/components/Tabs/setEvent.js +29 -0
- package/dist/components/Tabs/style.css +1 -0
- package/dist/components/WithSide/getProps.js +14 -0
- package/dist/components/WithSide/index.js +9 -0
- package/dist/components/getFilterProps.js +23 -0
- package/dist/components/getInsetProps.js +8 -0
- package/dist/components/getMediaProps.js +14 -0
- package/dist/components/getTransformProps.js +8 -0
- package/dist/config/prop_list.js +395 -0
- package/dist/config/tokens.js +67 -0
- package/dist/config.js +9 -0
- package/dist/css/all.css +1 -0
- package/dist/css/all_no_layer.css +1 -0
- package/dist/css/base.css +1 -0
- package/dist/css/dynamic.css +1 -0
- package/dist/css/layout.css +1 -0
- package/dist/css/props.css +1 -0
- package/dist/css/reset.css +1 -0
- package/dist/css/state.css +1 -0
- package/dist/css/utility.css +1 -0
- package/dist/css/with_layer.css +1 -0
- package/dist/index.js +54 -0
- package/dist/lib/getBpData.js +13 -0
- package/dist/lib/getLismProps.js +239 -0
- package/dist/lib/getMaybeCssVar.js +61 -0
- package/dist/lib/getMaybeUtilValue.js +6 -0
- package/dist/lib/helper/atts.js +11 -0
- package/dist/lib/helper/filterEmptyObj.js +9 -0
- package/dist/lib/helper/hasKeys.js +6 -0
- package/dist/lib/helper/isEmptyObj.js +6 -0
- package/dist/lib/helper/isNumStr.js +6 -0
- package/dist/lib/helper/splitWithComma.js +6 -0
- package/dist/lib/isPresetValue.js +6 -0
- package/dist/lib/isTokenValue.js +9 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +604 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +28 -0
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js +10 -0
- package/dist/scripts/accordion.js +4 -0
- package/dist/scripts/modal.js +4 -0
- package/dist/scripts/tabs.js +6 -0
- package/package.json +22 -22
- package/packages/astro/Accordion/AccBody.astro +15 -0
- package/packages/astro/Accordion/AccHeader.astro +13 -0
- package/packages/astro/Accordion/AccIcon.astro +19 -0
- package/packages/astro/Accordion/AccLabel.astro +12 -0
- package/packages/astro/Accordion/Accordion.astro +21 -0
- package/packages/astro/Accordion/__setEvent.js +2 -0
- package/packages/astro/Accordion/index.js +7 -0
- package/packages/astro/Box/Box.astro +11 -0
- package/packages/astro/Box/index.js +1 -0
- package/packages/astro/Center/Center.astro +11 -0
- package/packages/astro/Center/index.js +1 -0
- package/packages/astro/Columns/Columns.astro +11 -0
- package/packages/astro/Columns/index.js +1 -0
- package/packages/astro/Container/Container.astro +11 -0
- package/packages/astro/Container/index.js +1 -0
- package/packages/astro/Decorator/Decorator.astro +13 -0
- package/packages/astro/Decorator/index.js +1 -0
- package/packages/astro/Divider/Divider.astro +12 -0
- package/packages/astro/Divider/index.js +1 -0
- package/packages/astro/Dummy/Dummy.astro +12 -0
- package/packages/astro/Dummy/index.js +1 -0
- package/packages/astro/Flex/Cluster.astro +11 -0
- package/packages/astro/Flex/Flex.astro +14 -0
- package/packages/astro/Flex/index.js +2 -0
- package/packages/astro/Frame/Frame.astro +12 -0
- package/packages/astro/Frame/index.js +1 -0
- package/packages/astro/Grid/Grid.astro +13 -0
- package/packages/astro/Grid/GridItem.astro +15 -0
- package/packages/astro/Grid/index.js +2 -0
- package/packages/astro/Icon/Icon.astro +25 -0
- package/packages/astro/Icon/SVG.astro +30 -0
- package/packages/astro/Icon/index.js +2 -0
- package/packages/astro/Layer/Layer.astro +15 -0
- package/packages/astro/Layer/index.js +1 -0
- package/packages/astro/LinkBox/LinkBox.astro +16 -0
- package/packages/astro/LinkBox/index.js +1 -0
- package/packages/astro/Lism/Link.astro +10 -0
- package/packages/astro/Lism/Lism.astro +14 -0
- package/packages/astro/Lism/Media.astro +24 -0
- package/packages/astro/Lism/Text.astro +10 -0
- package/packages/astro/Lism/index.js +4 -0
- package/packages/astro/Modal/Body.astro +14 -0
- package/packages/astro/Modal/CloseIconBtn.astro +24 -0
- package/packages/astro/Modal/Footer.astro +14 -0
- package/packages/astro/Modal/Header.astro +14 -0
- package/packages/astro/Modal/Inner.astro +13 -0
- package/packages/astro/Modal/Modal.astro +20 -0
- package/packages/astro/Modal/index.js +8 -0
- package/packages/astro/OverlayLink/OverlayLink.astro +10 -0
- package/packages/astro/OverlayLink/index.js +1 -0
- package/packages/astro/Spacer/Spacer.astro +11 -0
- package/packages/astro/Spacer/index.js +1 -0
- package/packages/astro/Stack/Stack.astro +7 -0
- package/packages/astro/Stack/index.js +1 -0
- package/packages/astro/Tabs/Tab.astro +26 -0
- package/packages/astro/Tabs/TabItem.astro +8 -0
- package/packages/astro/Tabs/TabList.astro +8 -0
- package/packages/astro/Tabs/TabPanel.astro +22 -0
- package/packages/astro/Tabs/Tabs.astro +60 -0
- package/packages/astro/Tabs/index.js +7 -0
- package/packages/astro/Tabs/transformTabitems.js +40 -0
- package/packages/astro/Test/Test.astro +14 -0
- package/packages/astro/Test/TestItem.astro +14 -0
- package/packages/astro/Test/index.js +4 -0
- package/packages/astro/WithSide/WithSide.astro +12 -0
- package/packages/astro/WithSide/index.js +1 -0
- package/packages/astro/helper/index.js +6 -0
- package/packages/astro/index.js +29 -0
- package/packages/astro/types.ts +28 -0
- package/packages/next-js/Accordion/Accordion.jsx +19 -0
- package/packages/next-js/Accordion/index.js +2 -0
- package/src/scss/__memo/_lh-auto-all.scss +46 -0
- package/src/scss/__memo/_lh-auto-h.scss +50 -0
- package/src/scss/__memo/_lh-manual.scss +58 -0
- package/src/scss/_auto_output.scss +194 -0
- package/src/scss/_mixin.scss +38 -0
- package/src/scss/_props.scss +771 -0
- package/src/scss/_query.scss +40 -0
- package/src/scss/_setting.scss +22 -0
- package/src/scss/all.scss +10 -0
- package/src/scss/all_no_layer.scss +26 -0
- package/src/scss/base/_dom.scss +140 -0
- package/src/scss/base/_tokens.scss +307 -0
- package/src/scss/base/index.scss +70 -0
- package/src/scss/dynamic/index.scss +4 -0
- package/src/scss/layout/__switcher.scss +11 -0
- package/src/scss/layout/_center.scss +5 -0
- package/src/scss/layout/_columns.scss +18 -0
- package/src/scss/layout/_divider.scss +6 -0
- package/src/scss/layout/_flex.scss +12 -0
- package/src/scss/layout/_frame.scss +13 -0
- package/src/scss/layout/_grid.scss +16 -0
- package/src/scss/layout/_icon.scss +19 -0
- package/src/scss/layout/_spacer.scss +3 -0
- package/src/scss/layout/_stack.scss +4 -0
- package/src/scss/layout/_withSide.scss +20 -0
- package/src/scss/layout/index.scss +12 -0
- package/src/scss/props/__/__aspect.bkup.scss +36 -0
- package/src/scss/props/__/__border.bkup.scss +197 -0
- package/src/scss/props/__/__color.bkup.scss +67 -0
- package/src/scss/props/__/__display.bukup.scss +11 -0
- package/src/scss/props/__/__flex-props.bkup.scss +66 -0
- package/src/scss/props/__/__gap.bkup.scss +18 -0
- package/src/scss/props/__/__grid-props.bkup.scss +158 -0
- package/src/scss/props/__/__margin.bkup.scss +92 -0
- package/src/scss/props/__/__padding.bkup.scss +93 -0
- package/src/scss/props/__/__place.bkup.scss +74 -0
- package/src/scss/props/__/__radius.bkup.scss +27 -0
- package/src/scss/props/__/__sizing.bkup.scss +45 -0
- package/src/scss/props/__/__typography.bkup.scss +146 -0
- package/src/scss/props/__memo.scss +15 -0
- package/src/scss/props/_border.scss +67 -0
- package/src/scss/props/_color.scss +16 -0
- package/src/scss/props/_hover.scss +73 -0
- package/src/scss/props/_transition.scss +20 -0
- package/src/scss/props/index.scss +12 -0
- package/src/scss/reset.scss +99 -0
- package/src/scss/state/__container.bkup.scss +145 -0
- package/src/scss/state/__flow.bkup.scss +52 -0
- package/src/scss/state/_container.scss +45 -0
- package/src/scss/state/_flow.scss +45 -0
- package/src/scss/state/_gutter.scss +3 -0
- package/src/scss/state/_has-divider.scss +30 -0
- package/src/scss/state/_layer.scss +7 -0
- package/src/scss/state/_linkbox.scss +18 -0
- package/src/scss/state/_size.scss +60 -0
- package/src/scss/state/index.scss +8 -0
- package/src/scss/utility/index.scss +76 -0
- package/src/scss/with_layer.scss +28 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { getProps } from '../../../dist/components/Modal/getProps';
|
|
4
|
+
import { Lism } from '../Lism';
|
|
5
|
+
|
|
6
|
+
// Propsの定義
|
|
7
|
+
interface Props extends LismProps {}
|
|
8
|
+
const { layout, ...props } = Astro.props || {};
|
|
9
|
+
const Layout = layout || Lism;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Layout tag='dialog' {...getProps(props)}>
|
|
13
|
+
<slot />
|
|
14
|
+
</Layout>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import setModal from '../../../dist/components/Modal/setModal';
|
|
18
|
+
console.log('modal.astro');
|
|
19
|
+
setModal();
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Root from './Modal.astro';
|
|
2
|
+
import Inner from './Inner.astro';
|
|
3
|
+
import Body from './Body.astro';
|
|
4
|
+
import CloseIconBtn from './CloseIconBtn.astro';
|
|
5
|
+
import Header from './Header.astro';
|
|
6
|
+
import Footer from './Footer.astro';
|
|
7
|
+
|
|
8
|
+
export default { Root, Inner, Body, CloseIconBtn, Header, Footer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
import getOverlayLinkProps from '../../../dist/components/OverlayLink/getProps';
|
|
5
|
+
|
|
6
|
+
interface Props extends LismProps {}
|
|
7
|
+
const props = Astro.props || {};
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<Lism {...getOverlayLinkProps(props)}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OverlayLink } from './OverlayLink.astro';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
import getProps from '../../../dist/components/Spacer/getProps';
|
|
5
|
+
|
|
6
|
+
// Propsの定義
|
|
7
|
+
interface Props extends LismProps {}
|
|
8
|
+
const props = Astro.props || {};
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism skipState {...getProps(props)} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Spacer } from './Spacer.astro';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stack } from './Stack.astro';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
|
|
5
|
+
export interface Props extends LismProps {
|
|
6
|
+
// controlId: string;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
tabId?: string | number;
|
|
9
|
+
index?: number;
|
|
10
|
+
}
|
|
11
|
+
const { tabId = 'tab', index = 0, isActive, ...props } = Astro.props;
|
|
12
|
+
const controlId = `${tabId}-${index}`;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<Lism
|
|
16
|
+
tag='button'
|
|
17
|
+
lismClass='d--tabs__tab'
|
|
18
|
+
className='re--style'
|
|
19
|
+
role='tab'
|
|
20
|
+
aria-controls={controlId}
|
|
21
|
+
aria-selected={isActive ? 'true' : 'false'}
|
|
22
|
+
skipState
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</Lism>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { GridItem } from '../Grid';
|
|
4
|
+
|
|
5
|
+
export interface Props extends LismProps {
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
tabId?: string | number;
|
|
8
|
+
index?: number;
|
|
9
|
+
}
|
|
10
|
+
const { tabId = 'tab', index = 0, isActive = false, ...props } = Astro.props;
|
|
11
|
+
const controlId = `${tabId}-${index}`;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<GridItem
|
|
15
|
+
id={controlId}
|
|
16
|
+
role='tabpanel'
|
|
17
|
+
aria-hidden={isActive ? 'false' : 'true'}
|
|
18
|
+
lismClass='d--tabs__panel'
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</GridItem>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Grid } from '../Grid';
|
|
4
|
+
// import Tab from './Tab.astro';
|
|
5
|
+
// import TabPanel from './TabPanel.astro';
|
|
6
|
+
import TabList from './TabList.astro';
|
|
7
|
+
import { uuidv4 } from '../helper/index.js';
|
|
8
|
+
import transformTabitems from './transformTabitems.js';
|
|
9
|
+
import getTabsProps from '../../../dist/components/Tabs/getProps';
|
|
10
|
+
|
|
11
|
+
// import TheTab from './TheTab.astro';}
|
|
12
|
+
// slotsについて: https://docs.astro.build/ja/reference/api-reference/#astroslots
|
|
13
|
+
|
|
14
|
+
// Propsの定義
|
|
15
|
+
interface Props extends LismProps {
|
|
16
|
+
uid?: string | number;
|
|
17
|
+
defaultIndex?: string | number;
|
|
18
|
+
}
|
|
19
|
+
// propsの取得
|
|
20
|
+
const { defaultIndex = 1, tabId = '', listProps = {}, ...props } = Astro.props || {};
|
|
21
|
+
|
|
22
|
+
// tabID生成
|
|
23
|
+
const theTabID = tabId ? tabId : uuidv4();
|
|
24
|
+
|
|
25
|
+
// 子要素の方から順番に処理されていくので、文字列処理でデータを抽出
|
|
26
|
+
const { btns, panels } = transformTabitems(
|
|
27
|
+
await Astro.slots.render('default'),
|
|
28
|
+
theTabID,
|
|
29
|
+
defaultIndex
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const hasItems = btns.length > 0;
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<Grid {...getTabsProps(props)}>
|
|
36
|
+
{
|
|
37
|
+
btns && (
|
|
38
|
+
<TabList {...listProps}>
|
|
39
|
+
{btns.map((btn, index) => {
|
|
40
|
+
return <Fragment key={index} set:html={btn} />;
|
|
41
|
+
})}
|
|
42
|
+
</TabList>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
{
|
|
46
|
+
panels.map((panel, index) => {
|
|
47
|
+
return <Fragment key={index} set:html={panel} />;
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
{!hasItems && <slot />}
|
|
51
|
+
</Grid>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
// import setEvent from './setEvent';
|
|
55
|
+
import setEvent from '../../../dist/components/Tabs/setEvent';
|
|
56
|
+
const tabsAll = document.querySelectorAll('.d--tabs');
|
|
57
|
+
tabsAll.forEach((tabs) => {
|
|
58
|
+
setEvent(tabs);
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as Root } from './Tabs.astro';
|
|
2
|
+
import { default as Item } from './TabItem.astro';
|
|
3
|
+
import { default as List } from './TabList.astro';
|
|
4
|
+
import { default as Panel } from './TabPanel.astro';
|
|
5
|
+
import { default as Tab } from './Tab.astro';
|
|
6
|
+
|
|
7
|
+
export default { Root, List, Panel, Item, Tab };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// <lism-placeholder-tabitem> → div.tabitem へ 変換
|
|
2
|
+
export default function transformHTML(htmlString, tabID, defaultIndex) {
|
|
3
|
+
let index = 1; // 1スタート
|
|
4
|
+
let btns = [];
|
|
5
|
+
let panels = [];
|
|
6
|
+
|
|
7
|
+
// <lism-placeholder-tabitem>でコンテンツを囲んでいるので中身を解析する。
|
|
8
|
+
const regex = /<lism-placeholder-tabitem(.*?)>(.*?)<\/lism-placeholder-tabitem>/gs;
|
|
9
|
+
const matches = [...htmlString.matchAll(regex)];
|
|
10
|
+
|
|
11
|
+
// console.log(matches);
|
|
12
|
+
matches.forEach((match) => {
|
|
13
|
+
// const tabItemAttrs = match[1]; // 使わないがdata-astro-source-file属性が自動でついてきたりするので、属性値があっても問題ないようにしている。
|
|
14
|
+
const tabItemContent = match[2];
|
|
15
|
+
|
|
16
|
+
const controlId = `${tabID}-${index}`;
|
|
17
|
+
const isActive = index === defaultIndex;
|
|
18
|
+
index++;
|
|
19
|
+
|
|
20
|
+
// <lism-placeholder-tabtbn>からタブボタンを生成
|
|
21
|
+
const btnMatch = tabItemContent.match(/<button(.*?)>(.*?)<\/button>(.*)/s);
|
|
22
|
+
if (!btnMatch) return;
|
|
23
|
+
let btnAtts = btnMatch[1];
|
|
24
|
+
let btnContent = btnMatch[2];
|
|
25
|
+
let panel = btnMatch[3];
|
|
26
|
+
|
|
27
|
+
// btnContent = btnContent.replace(` slot="tab"`, '');
|
|
28
|
+
btnAtts = btnAtts.replace(`aria-controls="tab-0"`, `aria-controls="${controlId}"`);
|
|
29
|
+
panel = panel.replace(`id="tab-0"`, `id="${controlId}"`);
|
|
30
|
+
if (isActive) {
|
|
31
|
+
btnAtts = btnAtts.replace(/aria-selected="false"/, 'aria-selected="true"');
|
|
32
|
+
panel = panel.replace(/aria-hidden="true"/, 'aria-hidden="false"');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
btns.push(`<button${btnAtts}>${btnContent}</button>`);
|
|
36
|
+
panels.push(panel);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return { btns, panels };
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
|
|
5
|
+
// Propsの定義
|
|
6
|
+
interface Props extends LismProps {
|
|
7
|
+
duration?: string | number;
|
|
8
|
+
}
|
|
9
|
+
const props = Astro.props || {};
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Lism data-lism='test' bd p='20' {...props}>
|
|
13
|
+
<slot />
|
|
14
|
+
</Lism>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
|
|
5
|
+
// Propsの定義
|
|
6
|
+
interface Props extends LismProps {
|
|
7
|
+
duration?: string | number;
|
|
8
|
+
}
|
|
9
|
+
const props = Astro.props || {};
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Lism data-lism='test-item' bd bds='dashed' {...props}>
|
|
13
|
+
<slot />
|
|
14
|
+
</Lism>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { LismProps } from '../types';
|
|
3
|
+
import { Lism } from '../Lism';
|
|
4
|
+
import { getWithSideProps } from '../../../dist/components/WithSide/getProps';
|
|
5
|
+
|
|
6
|
+
// Propsの定義
|
|
7
|
+
interface Props extends LismProps {}
|
|
8
|
+
|
|
9
|
+
const props = Astro.props || {};
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Lism {...getWithSideProps(props)}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as WithSide } from './WithSide.astro';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
|
|
2
|
+
export function uuidv4() {
|
|
3
|
+
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
4
|
+
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
|
5
|
+
);
|
|
6
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .astro でLismコンポーネントを配布
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// export { default as Lism } from './Lism/Lism.astro';
|
|
6
|
+
// export { Lism, Text, Media, Link } from './Lism';
|
|
7
|
+
export * from './Lism';
|
|
8
|
+
export * from './Dummy';
|
|
9
|
+
export * from './Box';
|
|
10
|
+
export * from './Flex';
|
|
11
|
+
export * from './Stack';
|
|
12
|
+
export * from './Grid';
|
|
13
|
+
export * from './Columns';
|
|
14
|
+
export * from './Center';
|
|
15
|
+
export * from './WithSide';
|
|
16
|
+
export * from './Frame';
|
|
17
|
+
|
|
18
|
+
export * from './Container';
|
|
19
|
+
export * from './Layer';
|
|
20
|
+
export * from './LinkBox';
|
|
21
|
+
|
|
22
|
+
export * from './Spacer';
|
|
23
|
+
export * from './Decorator';
|
|
24
|
+
export * from './Divider';
|
|
25
|
+
export * from './Icon';
|
|
26
|
+
|
|
27
|
+
export { default as Accordion } from './Accordion';
|
|
28
|
+
export { default as Modal } from './Modal';
|
|
29
|
+
export { default as Tabs } from './Tabs';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// export interface LismClass {
|
|
2
|
+
// b?: string;
|
|
3
|
+
// c?: string;
|
|
4
|
+
// l?: string;
|
|
5
|
+
// e?: string;
|
|
6
|
+
// }
|
|
7
|
+
export interface LismStyle {
|
|
8
|
+
[key: string]: number | string; // 任意のプロパティを受け取る
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface exProps {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface LismProps {
|
|
16
|
+
lismClass?: string;
|
|
17
|
+
_lismClass?: string[];
|
|
18
|
+
lismStyle?: LismStyle;
|
|
19
|
+
lismState?: string[];
|
|
20
|
+
skipState?: boolean;
|
|
21
|
+
as?: any;
|
|
22
|
+
tag?: string;
|
|
23
|
+
variant?: string;
|
|
24
|
+
// lismState?: ;
|
|
25
|
+
// style
|
|
26
|
+
exProps?: exProps;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Accordion from '../../../dist/components/Accordion';
|
|
3
|
+
// import 'style';
|
|
4
|
+
|
|
5
|
+
export function Root(props) {
|
|
6
|
+
return <Accordion.Root {...props} />;
|
|
7
|
+
}
|
|
8
|
+
export function Header(props) {
|
|
9
|
+
return <Accordion.Header {...props} />;
|
|
10
|
+
}
|
|
11
|
+
export function Label(props) {
|
|
12
|
+
return <Accordion.Label {...props} />;
|
|
13
|
+
}
|
|
14
|
+
export function Body(props) {
|
|
15
|
+
return <Accordion.Body {...props} />;
|
|
16
|
+
}
|
|
17
|
+
export function Icon(props) {
|
|
18
|
+
return <Accordion.Icon {...props} />;
|
|
19
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* タイポグラフィオート計算でを * に対して指定するケース
|
|
3
|
+
* 親要素の --lh の引き継ぎに問題が発生する。
|
|
4
|
+
→ 下限・上限を超える値がセットされている時、その値を継承できない。
|
|
5
|
+
*/
|
|
6
|
+
:root{
|
|
7
|
+
--lh--min: 1.3em;
|
|
8
|
+
--lh--max: 1.9em;
|
|
9
|
+
}
|
|
10
|
+
// ---------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
// 全要素で --fz, --lh を受け取れるように
|
|
13
|
+
:where(body *){
|
|
14
|
+
font-size: var(--fz, inherit);
|
|
15
|
+
line-height: var(--lh, inherit);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// [style*="--fz:"]{
|
|
19
|
+
// font-size: var(--fz);
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// :not([style*="font-size"]) にしてても、* によって親要素側で計算されはじめたりするので、多少影響は受ける
|
|
24
|
+
*:not([style*="font-size"]),
|
|
25
|
+
[style*="--fz:"], // --fzでフォントサイズ指定されているもの
|
|
26
|
+
[class*="-fz\:"], {
|
|
27
|
+
|
|
28
|
+
--slope: 0.35; // 自動計算用の傾き
|
|
29
|
+
--base: calc(var(--lh, var(--root--lh)) * 1em); // 計算ように単位をつけておく
|
|
30
|
+
|
|
31
|
+
// 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
|
|
32
|
+
line-height: clamp(
|
|
33
|
+
min(var(--lh--min), var(--base)),
|
|
34
|
+
calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz, 1em)) ),
|
|
35
|
+
max(var(--lh--max), var(--base))
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// .-fz:などに対して--lh指定されてあった場合に上書きできる位置で
|
|
40
|
+
// [style*="--lh:"]{
|
|
41
|
+
// line-height: var(--lh);
|
|
42
|
+
// --lh--min: min(var(--lh--min), var(--base));
|
|
43
|
+
// --lh--max: max(var(--lh--min), var(--base));
|
|
44
|
+
// }
|
|
45
|
+
|
|
46
|
+
// ---------------------------------------------------------------------
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* タイポグラフィ
|
|
3
|
+
*/
|
|
4
|
+
:root {
|
|
5
|
+
--lh--min: 1.3em;
|
|
6
|
+
--lh--max: 1.9em;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// ---------------------------------------------------------------------
|
|
10
|
+
body {
|
|
11
|
+
--fz: 1em; // 計算用に --fz の単位をem化しておく
|
|
12
|
+
--lh: var(--root--lh); // 任意の値
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// :where(body *),
|
|
16
|
+
:where(:is(h1, h2, h3, h4, h5, h6, p)) {
|
|
17
|
+
font-size: var(--fz, inherit);
|
|
18
|
+
line-height: var(--lh, inherit);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// [style*="--fz:"]{
|
|
22
|
+
// font-size: var(--fz);
|
|
23
|
+
// }
|
|
24
|
+
|
|
25
|
+
// :where(:is(h1, h2, h3, h4, h5, h6, p)):not([style*="font-size"]){
|
|
26
|
+
// color: red;
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
.-typoCalc, // (仮名) 自動計算対象にするというユーティリティクラス合ったほうが便利かも...?
|
|
30
|
+
[style*="--fz:"], // --fzでフォントサイズ指定されているもの
|
|
31
|
+
:where(:is(h1, h2, h3, h4, h5, h6, p)):not([style*="font-size"]),
|
|
32
|
+
[class*="-fz\:"] {
|
|
33
|
+
--slope: 0.35; // 自動計算用の傾き
|
|
34
|
+
--base: calc(var(--lh) * 1em); // 計算ように単位をつけておく
|
|
35
|
+
|
|
36
|
+
// 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
|
|
37
|
+
line-height: clamp(
|
|
38
|
+
min(var(--lh--min), var(--base)),
|
|
39
|
+
calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz))),
|
|
40
|
+
max(var(--lh--max), var(--base))
|
|
41
|
+
);
|
|
42
|
+
font-size: var(--fz);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// --lh指定されている要素自身はその値で上書き。→ .-lh: 使ってもらう?
|
|
46
|
+
[style*='--lh:'] {
|
|
47
|
+
line-height: var(--lh);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ---------------------------------------------------------------------
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
// 各fzサイズ用のline-height
|
|
3
|
+
--ls--6L--lh: 1.2;
|
|
4
|
+
--ls--5L--lh: 1.4;
|
|
5
|
+
--ls--4L--lh: 1.4;
|
|
6
|
+
--ls--3L--lh: 1.5;
|
|
7
|
+
--ls--2L--lh: 1.6;
|
|
8
|
+
--ls--L--lh: 1.6;
|
|
9
|
+
|
|
10
|
+
// 1,
|
|
11
|
+
// 1.25, 5XL
|
|
12
|
+
// 1.4 4XL
|
|
13
|
+
// 1.5, 2XL, 3XL,
|
|
14
|
+
// 1.6, L XL
|
|
15
|
+
// 1.75 base
|
|
16
|
+
// 2,
|
|
17
|
+
// 2.5
|
|
18
|
+
|
|
19
|
+
// 1, xs sm md, lg xl
|
|
20
|
+
// 1, 1.25, 1.5. 1.75, 2, 2.5
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h1 {
|
|
24
|
+
--lh: var(--ls--4L--lh);
|
|
25
|
+
}
|
|
26
|
+
h2 {
|
|
27
|
+
--lh: var(--ls--3L--lh);
|
|
28
|
+
}
|
|
29
|
+
h3 {
|
|
30
|
+
--lh: var(--ls--2L--lh);
|
|
31
|
+
}
|
|
32
|
+
h4 {
|
|
33
|
+
--lh: var(--ls--L--lh);
|
|
34
|
+
}
|
|
35
|
+
// h5 {}
|
|
36
|
+
// h6 {}
|
|
37
|
+
|
|
38
|
+
// .-fz\:xs {}
|
|
39
|
+
// .-fz\:s {}
|
|
40
|
+
// .-fz\:m {}
|
|
41
|
+
.-fz\:l {
|
|
42
|
+
--lh: var(--ls--L--lh);
|
|
43
|
+
}
|
|
44
|
+
.-fz\:xl {
|
|
45
|
+
--lh: var(--ls--2L--lh);
|
|
46
|
+
}
|
|
47
|
+
.-fz\:2xl {
|
|
48
|
+
--lh: var(--ls--3L--lh);
|
|
49
|
+
}
|
|
50
|
+
.-fz\:3xl {
|
|
51
|
+
--lh: var(--ls--4L--lh);
|
|
52
|
+
}
|
|
53
|
+
.-fz\:4xl {
|
|
54
|
+
--lh: var(--ls--5L--lh);
|
|
55
|
+
}
|
|
56
|
+
.-fz\:5xl {
|
|
57
|
+
--lh: var(--ls--6L--lh);
|
|
58
|
+
}
|