@lism-css/ui 0.8.0 → 0.9.1

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.
@@ -34,7 +34,7 @@ export function getPanelProps({ lismClass, _contextID, accID, isOpen, ...props }
34
34
  export namespace defaultProps {
35
35
  namespace button {
36
36
  let lismClass: string;
37
- let tag: string;
37
+ let as: string;
38
38
  let layout: string;
39
39
  let setPlain: number;
40
40
  let g: string;
@@ -44,7 +44,7 @@ export namespace defaultProps {
44
44
  }
45
45
  let icon: {
46
46
  lismClass: string;
47
- tag: string;
47
+ as: string;
48
48
  pi: string;
49
49
  fxsh: string;
50
50
  'aria-hidden': string;
@@ -15,7 +15,7 @@ export function AccordionItem({ children, ...props }: {
15
15
  }): React.JSX.Element;
16
16
  /**
17
17
  * 見出しエリアのラッパー(デフォルトは <div role="heading">)
18
- * tag に h2〜h6 を指定すると role は付与されない
18
+ * as に h2〜h6 を指定すると role は付与されない
19
19
  */
20
20
  export function Heading({ children, ...props }: {
21
21
  [x: string]: any;
@@ -17,13 +17,13 @@ export namespace defaultProps {
17
17
  namespace title {
18
18
  let lismClass_1: string;
19
19
  export { lismClass_1 as lismClass };
20
- export let tag: string;
20
+ export let as: string;
21
21
  export let fx: string;
22
22
  export let setPlain: number;
23
23
  }
24
24
  let icon: {
25
25
  lismClass: string;
26
- tag: string;
26
+ as: string;
27
27
  'aria-hidden': string;
28
28
  };
29
29
  namespace body {
@@ -7,7 +7,7 @@ export function getProps({ lismClass, duration, style, ...props }: {
7
7
  style: {};
8
8
  lismClass: string;
9
9
  setPlain: boolean;
10
- tag: string;
10
+ as: string;
11
11
  };
12
12
  export function getInnerProps({ lismClass, offset, style, ...props }: {
13
13
  [x: string]: any;
@@ -23,14 +23,14 @@ export namespace defaultProps {
23
23
  let lismClass: string;
24
24
  }
25
25
  namespace closeBtn {
26
- let tag: string;
26
+ let as: string;
27
27
  let setPlain: boolean;
28
28
  let hov: string;
29
29
  let d: string;
30
30
  }
31
31
  namespace openBtn {
32
- let tag_1: string;
33
- export { tag_1 as tag };
32
+ let as_1: string;
33
+ export { as_1 as as };
34
34
  let setPlain_1: boolean;
35
35
  export { setPlain_1 as setPlain };
36
36
  let hov_1: string;
@@ -13,7 +13,7 @@ export function getRootProps({ hovC, hovBgc, itemP, style, ...props }: {
13
13
  style?: object | undefined;
14
14
  }): {
15
15
  lismClass: string;
16
- tag: string;
16
+ as: string;
17
17
  style: {};
18
18
  };
19
19
  /**
@@ -27,6 +27,6 @@ export function getItemProps(props: any): any;
27
27
  /**
28
28
  * NavMenu.Link のプロパティを処理
29
29
  * @param {string} [props.href] - リンク先URL。指定時は a タグになる
30
- * @param {string} [props.tag='span'] - HTML タグ
30
+ * @param {string} [props.as='span'] - HTML タグ
31
31
  */
32
- export function getLinkProps({ href, tag, ...props }?: string): any;
32
+ export function getLinkProps({ href, as, ...props }?: string): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lism-css/ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "UI components by lism-css.",
5
5
  "author": {
6
6
  "name": "ddryo",
@@ -39,20 +39,21 @@
39
39
  "url": "https://github.com/lism-css/lism-css/issues"
40
40
  },
41
41
  "dependencies": {
42
- "lism-css": "0.8.4"
42
+ "lism-css": "0.9.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@babel/cli": "^7.27.2",
46
- "@babel/core": "^7.27.3",
47
- "@babel/preset-env": "^7.27.2",
48
- "@babel/preset-react": "^7.27.1",
49
- "@rollup/plugin-babel": "^6.0.4",
50
- "@vitejs/plugin-react-swc": "^3.10.0",
51
- "glob": "^11.0.2",
52
- "rollup": "^4.41.1",
45
+ "@babel/cli": "^7.28.6",
46
+ "@babel/core": "^7.29.0",
47
+ "@babel/preset-env": "^7.29.0",
48
+ "@babel/preset-react": "^7.28.5",
49
+ "@rollup/plugin-babel": "^6.1.0",
50
+ "@types/node": "^25.5.0",
51
+ "@vitejs/plugin-react-swc": "^3.11.0",
52
+ "glob": "^13.0.6",
53
+ "rollup": "^4.59.0",
53
54
  "typescript": "~5.8.3",
54
55
  "unplugin-dts": "1.0.0-beta.6",
55
- "vite": "^6.3.5"
56
+ "vite": "^6.4.1"
56
57
  },
57
58
  "peerDependencies": {
58
59
  "@types/react": "*",
@@ -2,7 +2,7 @@ import atts from 'lism-css/lib/helper/atts';
2
2
 
3
3
  export function getRootProps({ lismClass, allowMultiple, ...props }) {
4
4
  props.lismClass = atts(lismClass, 'c--accordion');
5
- if (allowMultiple) props['data-allow-multiple'] = 'true';
5
+ if (allowMultiple) props['data-allow-multiple'] = '';
6
6
  return props;
7
7
  }
8
8
 
@@ -15,14 +15,14 @@ export function getItemProps({ lismClass, ...props }) {
15
15
  export function getHeadingProps(props) {
16
16
  const defaultProps = {
17
17
  lismClass: 'c--accordion_heading',
18
- tag: 'div',
18
+ as: 'div',
19
19
  setPlain: 1,
20
20
  };
21
21
 
22
22
  const returnProps = { ...defaultProps, ...props };
23
23
 
24
24
  // div の時は role 付与
25
- if (returnProps.tag === 'div') {
25
+ if (returnProps.as === 'div') {
26
26
  returnProps.role = 'heading';
27
27
  }
28
28
  return returnProps;
@@ -58,7 +58,7 @@ export const defaultProps = {
58
58
  // header: { lismClass: 'c--accordion_header' },
59
59
  button: {
60
60
  lismClass: 'c--accordion_button',
61
- tag: 'button',
61
+ as: 'button',
62
62
  layout: 'flex',
63
63
  setPlain: 1,
64
64
  g: '10',
@@ -68,7 +68,7 @@ export const defaultProps = {
68
68
  },
69
69
  icon: {
70
70
  lismClass: 'c--accordion_icon a--icon',
71
- tag: 'span',
71
+ as: 'span',
72
72
  // d: 'grid',
73
73
  pi: 'center',
74
74
  fxsh: '0',
@@ -47,7 +47,7 @@ export function AccordionItem({ children, ...props }) {
47
47
 
48
48
  /**
49
49
  * 見出しエリアのラッパー(デフォルトは <div role="heading">)
50
- * tag に h2〜h6 を指定すると role は付与されない
50
+ * as に h2〜h6 を指定すると role は付与されない
51
51
  */
52
52
  export function Heading({ children, ...props }) {
53
53
  return <Lism {...getHeadingProps(props)}>{children}</Lism>;
@@ -9,14 +9,7 @@ export type AlertProps = {
9
9
  [key: string]: unknown;
10
10
  };
11
11
 
12
- export default function getAlertProps({
13
- type = 'alert',
14
- keycolor,
15
- layout = 'flex',
16
- icon,
17
- flow = 's',
18
- ...props
19
- }: AlertProps) {
12
+ export default function getAlertProps({ type = 'alert', keycolor, layout = 'flex', icon, flow = 's', ...props }: AlertProps) {
20
13
  const presetData = type ? PRESETS[type] : null;
21
14
  const _icon = icon || presetData?.icon || 'info';
22
15
  const _color = keycolor || presetData?.color || 'currentColor';
@@ -25,7 +18,7 @@ export default function getAlertProps({
25
18
  icon: _icon,
26
19
  layout,
27
20
  flow,
28
- lismClass: 'c--alert u-cbox',
21
+ lismClass: 'c--alert u--cbox',
29
22
  keycolor: _color,
30
23
  ai: 'center',
31
24
  p: '15',
@@ -11,6 +11,6 @@ const _propConfig = {
11
11
  };
12
12
  ---
13
13
 
14
- <Lism lismClass='c--badge' tag='span' d='inline-flex' fz='xs' lh='xs' py='5' px='10' bdrs='10' _propConfig={_propConfig} {...props}>
14
+ <Lism lismClass='c--badge' as='span' d='inline-flex' fz='xs' lh='xs' py='5' px='10' bdrs='10' _propConfig={_propConfig} {...props}>
15
15
  <slot />
16
16
  </Lism>
@@ -8,7 +8,5 @@ export default function Badge(props) {
8
8
  bgc: { isVar: 1 },
9
9
  };
10
10
 
11
- return (
12
- <Lism lismClass='c--badge' tag='span' d='inline-flex' fz='xs' lh='xs' py='5' px='10' bdrs='10' _propConfig={_propConfig} {...props} />
13
- );
11
+ return <Lism lismClass='c--badge' as='span' d='inline-flex' fz='xs' lh='xs' py='5' px='10' bdrs='10' _propConfig={_propConfig} {...props} />;
14
12
  }
@@ -11,6 +11,6 @@ const _propConfig = {
11
11
  };
12
12
  ---
13
13
 
14
- <Flex lismClass='c--button' tag='a' lh='s' py='10' px='20' hov='o' _propConfig={_propConfig} {...props}>
14
+ <Flex lismClass='c--button' as='a' lh='s' py='10' px='20' hov='o' _propConfig={_propConfig} {...props}>
15
15
  <slot />
16
16
  </Flex>
@@ -8,7 +8,5 @@ export default function Button(props) {
8
8
  bgc: { isVar: 1 },
9
9
  };
10
10
 
11
- return (
12
- <Flex lismClass='c--button' tag='a' lh='s' py='10' px='20' hov='o' _propConfig={_propConfig} {...props} />
13
- );
11
+ return <Flex lismClass='c--button' as='a' lh='s' py='10' px='20' hov='o' _propConfig={_propConfig} {...props} />;
14
12
  }
@@ -18,7 +18,7 @@ export default function getCalloutProps({ type = 'note', keycolor, icon, title,
18
18
  icon: _icon,
19
19
  title,
20
20
  flow,
21
- lismClass: 'c--callout u-cbox',
21
+ lismClass: 'c--callout u--cbox',
22
22
  keycolor: _keycolor,
23
23
  p: '20',
24
24
  g: '10',
@@ -33,8 +33,8 @@ const { 'data-chat-dir': direction, ...chatProps } = getChatProps(inputProps);
33
33
  }
34
34
  {name && <Lism {...defaultProps.name}>{name}</Lism>}
35
35
  <Lism {...defaultProps.body}>
36
- <Decorator {...defaultProps.deco} class='u-cbox is--skipFlow' />
37
- <Flow {...defaultProps.content} class='u-cbox' flow={flow} jslf={direction}>
36
+ <Decorator {...defaultProps.deco} class='u--cbox is--skipFlow' />
37
+ <Flow {...defaultProps.content} class='u--cbox' flow={flow} jslf={direction}>
38
38
  <slot />
39
39
  </Flow>
40
40
  </Lism>
@@ -14,8 +14,8 @@ export default function Chat({ name, avatar, flow = 's', children, ...props }) {
14
14
  )}
15
15
  {name && <Lism {...defaultProps.name}>{name}</Lism>}
16
16
  <Lism {...defaultProps.body}>
17
- <Decorator {...defaultProps.deco} className='u-cbox is--skipFlow' />
18
- <Flow {...defaultProps.content} className='u-cbox' flow={flow} jslf={direction}>
17
+ <Decorator {...defaultProps.deco} className='u--cbox is--skipFlow' />
18
+ <Flow {...defaultProps.content} className='u--cbox' flow={flow} jslf={direction}>
19
19
  {children}
20
20
  </Flow>
21
21
  </Lism>
@@ -5,6 +5,6 @@ import { defaultProps } from '../getProps';
5
5
  const props = Astro.props || {};
6
6
  ---
7
7
 
8
- <Lism tag='summary' {...defaultProps.summary} {...props}>
8
+ <Lism as='summary' {...defaultProps.summary} {...props}>
9
9
  <slot />
10
10
  </Lism>
@@ -16,8 +16,8 @@ export function getDetailsProps({ lismClass, ...props }) {
16
16
  */
17
17
  export const defaultProps = {
18
18
  summary: { lismClass: 'c--details_summary', layout: 'flex', g: '10', ai: 'center' },
19
- title: { lismClass: 'c--details_title', tag: 'span', fx: '1', setPlain: 1 },
20
- icon: { lismClass: 'c--details_icon a--icon', tag: 'span', 'aria-hidden': 'true' },
19
+ title: { lismClass: 'c--details_title', as: 'span', fx: '1', setPlain: 1 },
20
+ icon: { lismClass: 'c--details_icon a--icon', as: 'span', 'aria-hidden': 'true' },
21
21
  body: { lismClass: 'c--details_body' },
22
22
  content: { lismClass: 'c--details_content', layout: 'flow', flow: 's' },
23
23
  };
@@ -24,7 +24,7 @@ export function Details({ children, ...props }) {
24
24
  */
25
25
  export function Summary({ children, ...props }) {
26
26
  return (
27
- <Lism tag='summary' {...defaultProps.summary} {...props}>
27
+ <Lism as='summary' {...defaultProps.summary} {...props}>
28
28
  {children}
29
29
  </Lism>
30
30
  );
@@ -17,7 +17,7 @@ const btnProps = { ...defaultProps.closeBtn, ...props };
17
17
  ) : (
18
18
  <Lism data-modal-close={modalId} {...btnProps}>
19
19
  <Icon icon={icon || 'x'} />
20
- <span class='u-hidden'>{srText || 'Close'}</span>
20
+ <span class='u--srOnly'>{srText || 'Close'}</span>
21
21
  </Lism>
22
22
  )
23
23
  }
@@ -9,7 +9,7 @@ export function getProps({ lismClass = '', duration, style = {}, ...props }) {
9
9
  style['--duration'] = duration;
10
10
  }
11
11
 
12
- return { tag: 'dialog', ...theProps, style, ...props };
12
+ return { as: 'dialog', ...theProps, style, ...props };
13
13
  }
14
14
 
15
15
  export function getInnerProps({ lismClass = '', offset, style = {}, ...props }) {
@@ -25,6 +25,6 @@ export function getInnerProps({ lismClass = '', offset, style = {}, ...props })
25
25
 
26
26
  export const defaultProps = {
27
27
  body: { lismClass: 'c--modal_body' },
28
- closeBtn: { tag: 'button', setPlain: true, hov: 'o', d: 'in-flex' },
29
- openBtn: { tag: 'button', setPlain: true, hov: 'o', d: 'in-flex' },
28
+ closeBtn: { as: 'button', setPlain: true, hov: 'o', d: 'in-flex' },
29
+ openBtn: { as: 'button', setPlain: true, hov: 'o', d: 'in-flex' },
30
30
  };
@@ -12,7 +12,7 @@ export default function CloseBtn({ children, modalId = '', icon, srText = 'Close
12
12
  ) : (
13
13
  <>
14
14
  <Icon icon={icon || 'x'} />
15
- <span className='u-hidden'>{srText || 'Close'}</span>
15
+ <span className='u--srOnly'>{srText || 'Close'}</span>
16
16
  </>
17
17
  )}
18
18
  </Lism>
@@ -20,7 +20,7 @@ export function getRootProps({ hovC, hovBgc, itemP, style = {}, ...props }) {
20
20
 
21
21
  return {
22
22
  lismClass: 'c--navMenu',
23
- tag: 'ul',
23
+ as: 'ul',
24
24
  style: computedStyle,
25
25
  ...props,
26
26
  };
@@ -32,7 +32,7 @@ export function getRootProps({ hovC, hovBgc, itemP, style = {}, ...props }) {
32
32
  export function getNestProps(props) {
33
33
  return {
34
34
  lismClass: 'c--navMenu_nest',
35
- tag: 'ul',
35
+ as: 'ul',
36
36
  'px-s': '20',
37
37
  ...props,
38
38
  };
@@ -44,7 +44,7 @@ export function getNestProps(props) {
44
44
  export function getItemProps(props) {
45
45
  return {
46
46
  lismClass: 'c--navMenu_item',
47
- tag: 'li',
47
+ as: 'li',
48
48
  ...props,
49
49
  };
50
50
  }
@@ -52,12 +52,12 @@ export function getItemProps(props) {
52
52
  /**
53
53
  * NavMenu.Link のプロパティを処理
54
54
  * @param {string} [props.href] - リンク先URL。指定時は a タグになる
55
- * @param {string} [props.tag='span'] - HTML タグ
55
+ * @param {string} [props.as='span'] - HTML タグ
56
56
  */
57
- export function getLinkProps({ href, tag = 'span', ...props }) {
57
+ export function getLinkProps({ href, as = 'span', ...props }) {
58
58
  return {
59
59
  lismClass: 'c--navMenu_link',
60
- tag: href ? 'a' : tag,
60
+ as: href ? 'a' : as,
61
61
  href,
62
62
  c: 'inherit',
63
63
  ...props,
@@ -12,6 +12,6 @@ const { tabId = 'tab', index = 0, isActive, ...props } = Astro.props;
12
12
  const controlId = `${tabId}-${index}`;
13
13
  ---
14
14
 
15
- <Lism tag='button' lismClass='c--tabs_tab' setPlain role='tab' aria-controls={controlId} aria-selected={isActive ? 'true' : 'false'} {...props}>
15
+ <Lism as='button' lismClass='c--tabs_tab' setPlain role='tab' aria-controls={controlId} aria-selected={isActive ? 'true' : 'false'} {...props}>
16
16
  <slot />
17
17
  </Lism>
@@ -6,7 +6,7 @@ export default function Tab({ tabId = 'tab', index = 0, isActive = false, ...pro
6
6
 
7
7
  return (
8
8
  <Lism
9
- tag='button'
9
+ as='button'
10
10
  lismClass='c--tabs_tab'
11
11
  setPlain
12
12
  role='tab'