@lism-css/ui 0.2.0 → 0.2.2

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.
Files changed (78) hide show
  1. package/dist/components/Accordion/astro/index.d.ts +6 -0
  2. package/dist/components/Alert/astro/index.d.ts +1 -0
  3. package/dist/components/Alert/getProps.d.ts +20 -0
  4. package/dist/components/Alert/presets.d.ts +6 -0
  5. package/dist/components/Alert/react/Alert.d.ts +5 -0
  6. package/dist/components/Alert/react/index.d.ts +1 -0
  7. package/dist/components/Avatar/astro/index.d.ts +1 -1
  8. package/dist/components/Badge/astro/index.d.ts +1 -1
  9. package/dist/components/Button/astro/index.d.ts +1 -1
  10. package/dist/components/Callout/astro/index.d.ts +1 -0
  11. package/dist/components/Callout/getProps.d.ts +22 -0
  12. package/dist/components/Callout/presets.d.ts +6 -0
  13. package/dist/components/Callout/react/Callout.d.ts +5 -0
  14. package/dist/components/Callout/react/index.d.ts +1 -0
  15. package/dist/components/Chat/astro/index.d.ts +1 -0
  16. package/dist/components/Chat/getProps.d.ts +53 -0
  17. package/dist/components/Chat/react/Chat.d.ts +7 -0
  18. package/dist/components/Chat/react/index.d.ts +1 -0
  19. package/dist/components/Modal/astro/index.d.ts +5 -0
  20. package/dist/components/NavMenu/astro/index.d.ts +11 -0
  21. package/dist/components/NavMenu/getProps.d.ts +32 -0
  22. package/dist/components/NavMenu/react/NavMenu.d.ts +16 -0
  23. package/dist/components/NavMenu/react/index.d.ts +8 -0
  24. package/dist/components/ShapeDivider/astro/index.d.ts +1 -0
  25. package/dist/components/ShapeDivider/getProps.d.ts +11 -0
  26. package/dist/components/ShapeDivider/react/ShapeDivider.d.ts +4 -0
  27. package/dist/components/ShapeDivider/react/index.d.ts +1 -0
  28. package/dist/components/Tabs/astro/index.d.ts +5 -0
  29. package/dist/components/astro.d.ts +5 -0
  30. package/dist/components/react.d.ts +5 -0
  31. package/dist/style.css +1 -1
  32. package/package.json +68 -68
  33. package/src/components/Alert/_style.css +1 -0
  34. package/src/components/Alert/astro/Alert.astro +17 -0
  35. package/src/components/Alert/astro/index.ts +1 -0
  36. package/src/components/Alert/getProps.ts +37 -0
  37. package/src/components/Alert/presets.ts +33 -0
  38. package/src/components/Alert/react/Alert.tsx +16 -0
  39. package/src/components/Alert/react/index.ts +1 -0
  40. package/src/components/Avatar/astro/Avatar.astro +0 -1
  41. package/src/components/Avatar/react/Avatar.jsx +0 -1
  42. package/src/components/Callout/_style.css +1 -0
  43. package/src/components/Callout/astro/Callout.astro +24 -0
  44. package/src/components/Callout/astro/index.ts +1 -0
  45. package/src/components/Callout/getProps.ts +32 -0
  46. package/src/components/Callout/presets.ts +33 -0
  47. package/src/components/Callout/react/Callout.tsx +23 -0
  48. package/src/components/Callout/react/index.ts +1 -0
  49. package/src/components/Chat/_style.css +64 -0
  50. package/src/components/Chat/astro/Chat.astro +41 -0
  51. package/src/components/Chat/astro/index.js +1 -0
  52. package/src/components/Chat/getProps.js +57 -0
  53. package/src/components/Chat/react/Chat.jsx +24 -0
  54. package/src/components/Chat/react/index.js +1 -0
  55. package/src/components/Modal/react/Body.jsx +1 -1
  56. package/src/components/Modal/react/CloseBtn.jsx +1 -2
  57. package/src/components/Modal/react/Inner.jsx +1 -1
  58. package/src/components/Modal/react/Modal.jsx +1 -1
  59. package/src/components/Modal/react/OpenBtn.jsx +1 -1
  60. package/src/components/NavMenu/_style.css +21 -0
  61. package/src/components/NavMenu/astro/Item.astro +8 -0
  62. package/src/components/NavMenu/astro/Link.astro +8 -0
  63. package/src/components/NavMenu/astro/Nest.astro +8 -0
  64. package/src/components/NavMenu/astro/Root.astro +9 -0
  65. package/src/components/NavMenu/astro/index.js +6 -0
  66. package/src/components/NavMenu/getProps.js +65 -0
  67. package/src/components/NavMenu/react/NavMenu.jsx +19 -0
  68. package/src/components/NavMenu/react/index.js +3 -0
  69. package/src/components/ShapeDivider/_style.css +56 -0
  70. package/src/components/ShapeDivider/astro/ShapeDivider.astro +31 -0
  71. package/src/components/ShapeDivider/astro/index.js +1 -0
  72. package/src/components/ShapeDivider/getProps.js +40 -0
  73. package/src/components/ShapeDivider/react/ShapeDivider.jsx +33 -0
  74. package/src/components/ShapeDivider/react/index.js +1 -0
  75. package/src/components/astro.ts +5 -0
  76. package/src/components/react.ts +5 -0
  77. package/src/style.scss +3 -0
  78. package/LICENSE +0 -21
@@ -1,3 +1,9 @@
1
+ import { default as Root } from './Accordion.astro';
2
+ import { default as Header } from './AccHeader.astro';
3
+ import { default as HeaderLabel } from './AccHeaderLabel.astro';
4
+ import { default as Body } from './AccBody.astro';
5
+ import { default as Icon } from './AccIcon.astro';
6
+ import { default as Label } from './AccLabel.astro';
1
7
  declare namespace _default {
2
8
  export { Root };
3
9
  export { Header };
@@ -0,0 +1 @@
1
+ export { default } from './Alert.astro';
@@ -0,0 +1,20 @@
1
+ export type AlertProps = {
2
+ type?: string;
3
+ keycolor?: string;
4
+ layout?: string;
5
+ icon?: string;
6
+ flow?: string;
7
+ [key: string]: unknown;
8
+ };
9
+ export default function getAlertProps({ type, keycolor, layout, icon, flow, ...props }: AlertProps): {
10
+ icon: string;
11
+ layout: string;
12
+ flow: string;
13
+ lismClass: string;
14
+ keycolor: string;
15
+ ai: string;
16
+ p: string;
17
+ g: string;
18
+ bd: boolean;
19
+ bdrs: string;
20
+ };
@@ -0,0 +1,6 @@
1
+ type PresetData = {
2
+ icon: string;
3
+ color: string;
4
+ };
5
+ declare const PRESETS: Record<string, PresetData>;
6
+ export default PRESETS;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ import { AlertProps } from '../getProps';
3
+ export default function Alert({ children, ...inputProps }: AlertProps & {
4
+ children?: ReactNode;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './Alert';
@@ -1 +1 @@
1
- export {};
1
+ export { default } from './Avatar.astro';
@@ -1 +1 @@
1
- export {};
1
+ export { default } from './Badge.astro';
@@ -1 +1 @@
1
- export {};
1
+ export { default } from './Button.astro';
@@ -0,0 +1 @@
1
+ export { default } from './Callout.astro';
@@ -0,0 +1,22 @@
1
+ export type CalloutProps = {
2
+ type?: string;
3
+ keycolor?: string;
4
+ icon?: string;
5
+ title?: string;
6
+ flow?: string;
7
+ [key: string]: unknown;
8
+ };
9
+ export default function getCalloutProps({ type, keycolor, icon, title, flow, ...props }: CalloutProps): {
10
+ icon: string;
11
+ title: string | undefined;
12
+ flow: string;
13
+ lismClass: string;
14
+ keycolor: string | null;
15
+ p: string;
16
+ g: string;
17
+ bdc: string;
18
+ 'bd-x-s': boolean;
19
+ bdw: string;
20
+ bxsh: string;
21
+ bdrs: string;
22
+ };
@@ -0,0 +1,6 @@
1
+ type PresetData = {
2
+ icon: string;
3
+ color: string;
4
+ };
5
+ declare const PRESETS: Record<string, PresetData>;
6
+ export default PRESETS;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ import { CalloutProps } from '../getProps';
3
+ export default function Callout({ children, ...inputProps }: CalloutProps & {
4
+ children?: ReactNode;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './Callout';
@@ -0,0 +1 @@
1
+ export { default } from './Chat.astro';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Chat コンポーネントのルートプロパティを生成
3
+ */
4
+ export default function getChatProps({ variant, direction, keycolor, ...props }: {
5
+ [x: string]: any;
6
+ variant?: string | undefined;
7
+ direction?: string | undefined;
8
+ keycolor?: string | undefined;
9
+ }): {
10
+ lismClass: string;
11
+ variant: string;
12
+ keycolor: string;
13
+ 'data-chat-dir': string;
14
+ ji: string;
15
+ };
16
+ export namespace defaultProps {
17
+ let avatar: {
18
+ lismClass: string;
19
+ bgc: string;
20
+ ar: string;
21
+ bdrs: string;
22
+ 'aria-hidden': string;
23
+ };
24
+ namespace name {
25
+ let lismClass: string;
26
+ let c: string;
27
+ let fs: string;
28
+ let fz: string;
29
+ let lh: string;
30
+ let py: string;
31
+ let px: string;
32
+ let aslf: string;
33
+ }
34
+ namespace body {
35
+ let lismClass_1: string;
36
+ export { lismClass_1 as lismClass };
37
+ export let pos: string;
38
+ }
39
+ namespace deco {
40
+ let lismClass_2: string;
41
+ export { lismClass_2 as lismClass };
42
+ let pos_1: string;
43
+ export { pos_1 as pos };
44
+ }
45
+ namespace content {
46
+ let lismClass_3: string;
47
+ export { lismClass_3 as lismClass };
48
+ export let bdrs: string;
49
+ export let p: string;
50
+ let lh_1: string;
51
+ export { lh_1 as lh };
52
+ }
53
+ }
@@ -0,0 +1,7 @@
1
+ export default function Chat({ name, avatar, flow, children, ...props }: {
2
+ [x: string]: any;
3
+ name: any;
4
+ avatar: any;
5
+ flow?: string | undefined;
6
+ children: any;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './Chat';
@@ -1,3 +1,8 @@
1
+ import { default as Root } from './Modal.astro';
2
+ import { default as Inner } from './Inner.astro';
3
+ import { default as Body } from './Body.astro';
4
+ import { default as CloseBtn } from './CloseBtn.astro';
5
+ import { default as OpenBtn } from './OpenBtn.astro';
1
6
  declare namespace _default {
2
7
  export { Root };
3
8
  export { Inner };
@@ -0,0 +1,11 @@
1
+ import { default as Root } from './Root.astro';
2
+ import { default as Nest } from './Nest.astro';
3
+ import { default as Item } from './Item.astro';
4
+ import { default as Link } from './Link.astro';
5
+ declare namespace _default {
6
+ export { Root };
7
+ export { Nest };
8
+ export { Item };
9
+ export { Link };
10
+ }
11
+ export default _default;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * NavMenu.Root のプロパティを処理
3
+ * @param {object} props - コンポーネントのプロパティ
4
+ * @param {string} [props.hovC] - ホバー時のテキストカラー(--hov-c として出力)
5
+ * @param {string} [props.hovBgc] - ホバー時の背景カラー(--hov-bgc として出力)
6
+ * @param {string} [props.itemP] - 各アイテムのパディング(--_item-p として出力)
7
+ * @param {object} [props.style] - スタイルオブジェクト
8
+ */
9
+ export function getRootProps({ hovC, hovBgc, itemP, style, ...props }: {
10
+ hovC?: string | undefined;
11
+ hovBgc?: string | undefined;
12
+ itemP?: string | undefined;
13
+ style?: object | undefined;
14
+ }): {
15
+ lismClass: string;
16
+ tag: string;
17
+ style: {};
18
+ };
19
+ /**
20
+ * NavMenu.Nest のプロパティを処理
21
+ */
22
+ export function getNestProps(props: any): any;
23
+ /**
24
+ * NavMenu.Item のプロパティを処理
25
+ */
26
+ export function getItemProps(props: any): any;
27
+ /**
28
+ * NavMenu.Link のプロパティを処理
29
+ * @param {string} [props.href] - リンク先URL。指定時は a タグになる
30
+ * @param {string} [props.tag='span'] - HTML タグ
31
+ */
32
+ export function getLinkProps({ href, tag, ...props }?: string): any;
@@ -0,0 +1,16 @@
1
+ export function Root({ children, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ }): import("react").JSX.Element;
5
+ export function Nest({ children, ...props }: {
6
+ [x: string]: any;
7
+ children: any;
8
+ }): import("react").JSX.Element;
9
+ export function Item({ children, ...props }: {
10
+ [x: string]: any;
11
+ children: any;
12
+ }): import("react").JSX.Element;
13
+ export function Link({ children, ...props }: {
14
+ [x: string]: any;
15
+ children: any;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Root, Item, Link, Nest } from './NavMenu';
2
+ declare namespace _default {
3
+ export { Root };
4
+ export { Item };
5
+ export { Link };
6
+ export { Nest };
7
+ }
8
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './ShapeDivider.astro';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ShapeDivider コンポーネントの共通プロパティ処理
3
+ * @param {string} [props.viewBox] - SVG の viewBox
4
+ * @param {boolean} [props.isAnimation] - アニメーションを有効にするか
5
+ * @param {boolean} [props.isEmpty] - シェイプを非表示にしてスペーサーとして使用
6
+ * @param {number} [props.level=5] - シェイプの高さレベル
7
+ * @param {string} [props.stretch] - 水平方向の引き伸ばし量
8
+ * @param {string} [props.offset] - 水平方向のオフセット
9
+ * @param {string} [props.flip] - X/Y/XY で反転方向を指定
10
+ */
11
+ export default function getProps({ viewBox, isAnimation, isEmpty, level, stretch, offset, flip, style, ...restProps }?: string): any;
@@ -0,0 +1,4 @@
1
+ export default function ShapeDivider({ children, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ }): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export { default } from './ShapeDivider';
@@ -1,3 +1,8 @@
1
+ import { default as Root } from './Tabs.astro';
2
+ import { default as List } from './TabList.astro';
3
+ import { default as Panel } from './TabPanel.astro';
4
+ import { default as Item } from './TabItem.astro';
5
+ import { default as Tab } from './Tab.astro';
1
6
  declare namespace _default {
2
7
  export { Root };
3
8
  export { List };
@@ -1,6 +1,11 @@
1
1
  export { default as Accordion } from './Accordion/astro';
2
+ export { default as Alert } from './Alert/astro';
2
3
  export { default as Avatar } from './Avatar/astro';
3
4
  export { default as Badge } from './Badge/astro';
4
5
  export { default as Button } from './Button/astro';
6
+ export { default as Callout } from './Callout/astro';
7
+ export { default as Chat } from './Chat/astro';
5
8
  export { default as Modal } from './Modal/astro';
9
+ export { default as NavMenu } from './NavMenu/astro';
10
+ export { default as ShapeDivider } from './ShapeDivider/astro';
6
11
  export { default as Tabs } from './Tabs/astro';
@@ -1,6 +1,11 @@
1
1
  export { default as Accordion } from './Accordion/react';
2
+ export { default as Alert } from './Alert/react';
2
3
  export { default as Avatar } from './Avatar/react';
3
4
  export { default as Badge } from './Badge/react';
4
5
  export { default as Button } from './Button/react';
6
+ export { default as Callout } from './Callout/react';
7
+ export { default as Chat } from './Chat/react';
5
8
  export { default as Modal } from './Modal/react';
9
+ export { default as NavMenu } from './NavMenu/react';
10
+ export { default as ShapeDivider } from './ShapeDivider/react';
6
11
  export { default as Tabs } from './Tabs/react';
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @layer lism.modules{.d--accordion{--duration:var(--acc-duration,0.25s)}.d--accordion[data-opened]{--_notOpen: }.d--accordion:not([data-opened]){--_isOpen: }.d--accordion_header{align-items:center;display:grid;gap:.5em;grid:auto/1fr auto;--focus-offset:-1px;&::-webkit-details-marker{display:none}}.d--accordion_body{display:grid;grid:1fr/auto;transition-duration:var(--duration);transition-property:margin-block,padding-block,opacity,grid-template}.d--accordion_inner{overflow:hidden}.d--accordion:not([data-opened])>.d--accordion_body{grid:0fr/auto;margin-block:0!important;padding-block:0!important}.d--accordion_icon{display:grid}.d--accordion_icon>.a--icon{transform:var(--_isOpen,scaleY(-1));transition:transform var(--duration)}.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism.modules{}@layer lism.modules{:where(.c--button)>.a--icon{scale:1.05}.c--button:where(.l--grid){grid-template-columns:minmax(1em,auto) 1fr minmax(1em,auto);justify-items:center}.c--button:where(.l--grid)>:not(.a--icon){grid-column:2}}.-hov\:reverse{--hov-c:var(--bgc);--hov-bgc:var(--c)}.-hov\:reverse:where(.c--button--fill){--hov-bgc:transparent}.-hov\:reverse:where(.c--button--outline){--hov-c:var(--base)}@media (any-hover:hover){.-hov\:reverse:hover{background-color:var(--hov-bgc)!important;color:var(--hov-c)!important}}
1
+ @layer lism.modules{.d--accordion{--duration:var(--acc-duration,0.25s)}.d--accordion[data-opened]{--_notOpen: }.d--accordion:not([data-opened]){--_isOpen: }.d--accordion_header{align-items:center;display:grid;gap:.5em;grid:auto/1fr auto;--focus-offset:-1px;&::-webkit-details-marker{display:none}}.d--accordion_body{display:grid;grid:1fr/auto;transition-duration:var(--duration);transition-property:margin-block,padding-block,opacity,grid-template}.d--accordion_inner{overflow:hidden}.d--accordion:not([data-opened])>.d--accordion_body{grid:0fr/auto;margin-block:0!important;padding-block:0!important}.d--accordion_icon{display:grid}.d--accordion_icon>.a--icon{transform:var(--_isOpen,scaleY(-1));transition:transform var(--duration)}.c--badge{--c:var(--base);--bgc:var(--text);--bdc:transparent;background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c)}.c--badge--outline{--c:var(--text);--bgc:transparent;--bdc:currentColor}.c--button{--c:var(--base);--bgc:var(--text);--bdc:var(--bgc);background-color:var(--bgc);border:1px solid var(--bdc);color:var(--c);gap:var(--s10);place-content:center;place-items:center;text-decoration:none}.c--button--outline{--c:var(--text);--bgc:transparent;--bdc:var(--c)}}@layer lism.modules{}@layer lism.modules{:where(.c--button)>.a--icon{scale:1.05}.c--button:where(.l--grid){grid-template-columns:minmax(1em,auto) 1fr minmax(1em,auto);justify-items:center}.c--button:where(.l--grid)>:not(.a--icon){grid-column:2}}@layer lism.modules{.c--chat{--cbox-bgPct:8%;--gta:"avatar name" "avatar body";--gtc:auto 1fr;--gtr:minmax(1.5rem,auto) auto;--_avator-size:clamp(48px,32px + 5cqw,64px);--_deco-size:calc(min(var(--_avator-size), 80px)/4 + 0.25rem);--_deco-mask:none;--_deco-t:0;--_deco-scale:1;--_deco-inset-x:0;gap:0 calc(var(--_deco-size) + 1px)}.c--chat_avatar{grid-area:avatar;width:var(--_avator-size)}.c--chat_name{grid-area:name}.c--chat_body{grid-area:body}.c--chat_content{max-width:var(--sz--s)}.c--chat_deco{height:var(--_deco-size);top:var(--_deco-t);inset-inline:var(--_deco-inset-x);-webkit-mask:var(--_deco-mask) center/contain no-repeat;mask:var(--_deco-mask) center/contain no-repeat;scale:var(--_deco-scale);width:var(--_deco-size)}.c--chat--speak{--_deco-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><path d="M8,8L8,8C7.4,4.8,5.4,2,2.6,0.4L2,0h6V8z"/></svg>')}[data-chat-dir=start]{--_deco-inset-x:auto calc(100% - 1px)}[data-chat-dir=end]{--_deco-scale:-1 1;--_deco-inset-x:calc(100% - 1px) auto;--gta:"name avatar" "body avatar";--gtc:1fr auto}}.c--chat--speak[data-chat-dir=start]>div>.c--chat_content{border-start-start-radius:0}.c--chat--speak[data-chat-dir=end]>div>.c--chat_content{border-start-end-radius:0}@layer lism.modules{.c--navMenu{--link-td:none;--hl:var(--hl--s);--_item-p:var(--s20);--focus-offset:-1px}.c--navMenu_nest{--_item-p:inherit}.c--navMenu_link{padding:var(--_item-p)}.c--navMenu_item,.c--navMenu_nest{--bdc:inherit}.c--shapeDivider{--level:0;--_inner-offset:0px;--_inner-stretch:1;--_flipX:1;--_flipY:1;height:clamp(5px * var(--level),1cqw * var(--level),12px * var(--level));overflow:visible}}@layer lism.modules{.c--shapeDivider:where([data-flip^=X]){--_flipX:-1}.c--shapeDivider:where([data-flip$=Y]){--_flipY:-1}.c--shapeDivider_inner{--offsetY:0.5px;--offsetX:-0.5px;height:100%;scale:calc(var(--_flipX)*var(--_inner-stretch)) var(--_flipY);translate:calc(var(--offsetX) + var(--_inner-offset)) calc(var(--offsetY)*var(--_flipY));width:calc(100% + 1px)}.c--shapeDivider_svg{display:block}:where([data-has-animation=true]) .c--shapeDivider_svg{animation:lism--slideShape 12s linear infinite alternate;transform-origin:100% 0}}@keyframes lism--slideShape{0%{transform:scaleX(4)}to{transform:scaleX(4) translateX(75%)}}
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
1
  {
2
- "name": "@lism-css/ui",
3
- "version": "0.2.0",
4
- "description": "UI components by lism-css.",
5
- "author": {
6
- "name": "ddryo",
7
- "url": "https://github.com/ddryo"
8
- },
9
- "license": "MIT",
10
- "keywords": [
11
- "css-framework",
12
- "astro-component",
13
- "react-component"
14
- ],
15
- "files": [
16
- "dist",
17
- "src"
18
- ],
19
- "type": "module",
20
- "main": "./dist/index.js",
21
- "exports": {
22
- "./react": {
23
- "import": "./src/components/react.js",
24
- "types": "./dist/components/index.d.ts"
25
- },
26
- "./astro": {
27
- "import": "./src/components/astro.js",
28
- "types": "./dist/components/index.d.ts"
29
- },
30
- "./scripts/*": "./dist/scripts/*.js",
31
- "./style.css": "./dist/style.css"
32
- },
33
- "homepage": "https://www.lism.style",
34
- "repository": {
35
- "type": "git",
36
- "url": "https://github.com/lism-css/lism-css/tree/main/packages/lism-css"
37
- },
38
- "bugs": {
39
- "url": "https://github.com/lism-css/lism-css/issues"
40
- },
41
- "dependencies": {
42
- "lism-css": "0.8.3"
43
- },
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",
53
- "typescript": "~5.8.3",
54
- "unplugin-dts": "1.0.0-beta.6",
55
- "vite": "^6.3.5"
56
- },
57
- "peerDependencies": {
58
- "@types/react": "*",
59
- "@types/react-dom": "*",
60
- "react": "^18 || ^19",
61
- "react-dom": "^18 || ^19"
62
- },
63
- "sideEffects": false,
64
- "scripts": {
65
- "dev": "vite",
66
- "build": "vite build && pnpm build:css",
67
- "build:css": "node build-css.js"
68
- }
69
- }
2
+ "name": "@lism-css/ui",
3
+ "version": "0.2.2",
4
+ "description": "UI components by lism-css.",
5
+ "author": {
6
+ "name": "ddryo",
7
+ "url": "https://github.com/ddryo"
8
+ },
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "css-framework",
12
+ "astro-component",
13
+ "react-component"
14
+ ],
15
+ "scripts": {
16
+ "dev": "vite",
17
+ "build": "vite build && pnpm build:css",
18
+ "build:css": "node build-css.js"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "src"
23
+ ],
24
+ "type": "module",
25
+ "main": "./dist/index.js",
26
+ "exports": {
27
+ "./react": {
28
+ "import": "./src/components/react.js",
29
+ "types": "./dist/components/index.d.ts"
30
+ },
31
+ "./astro": {
32
+ "import": "./src/components/astro.js",
33
+ "types": "./dist/components/index.d.ts"
34
+ },
35
+ "./scripts/*": "./dist/scripts/*.js",
36
+ "./style.css": "./dist/style.css"
37
+ },
38
+ "homepage": "https://www.lism.style",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/lism-css/lism-css/tree/main/packages/lism-css"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/lism-css/lism-css/issues"
45
+ },
46
+ "dependencies": {
47
+ "lism-css": "workspace:*"
48
+ },
49
+ "devDependencies": {
50
+ "@babel/cli": "^7.27.2",
51
+ "@babel/core": "^7.27.3",
52
+ "@babel/preset-env": "^7.27.2",
53
+ "@babel/preset-react": "^7.27.1",
54
+ "@rollup/plugin-babel": "^6.0.4",
55
+ "@vitejs/plugin-react-swc": "^3.10.0",
56
+ "glob": "^11.0.2",
57
+ "rollup": "^4.41.1",
58
+ "typescript": "~5.8.3",
59
+ "unplugin-dts": "1.0.0-beta.6",
60
+ "vite": "^6.3.5"
61
+ },
62
+ "peerDependencies": {
63
+ "@types/react": "*",
64
+ "@types/react-dom": "*",
65
+ "react": "^18 || ^19",
66
+ "react-dom": "^18 || ^19"
67
+ },
68
+ "sideEffects": false
69
+ }
@@ -0,0 +1 @@
1
+ /* Alert component styles */
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { Flow, Lism, Center, Icon } from 'lism-css/astro';
3
+ import getAlertProps, { type AlertProps } from '../getProps';
4
+
5
+ type Props = AlertProps;
6
+
7
+ const { icon, layout, flow, ...alertProps } = getAlertProps(Astro.props);
8
+ ---
9
+
10
+ <Lism layout={layout} {...alertProps}>
11
+ <Center isSide={layout === 'sideMain'} c='keycolor' fz='xl' fxsh='0'>
12
+ <Icon icon={icon} />
13
+ </Center>
14
+ <Flow flow={flow}>
15
+ <slot />
16
+ </Flow>
17
+ </Lism>
@@ -0,0 +1 @@
1
+ export { default } from './Alert.astro';
@@ -0,0 +1,37 @@
1
+ import PRESETS from './presets';
2
+
3
+ export type AlertProps = {
4
+ type?: string;
5
+ keycolor?: string;
6
+ layout?: string;
7
+ icon?: string;
8
+ flow?: string;
9
+ [key: string]: unknown;
10
+ };
11
+
12
+ export default function getAlertProps({
13
+ type = 'alert',
14
+ keycolor,
15
+ layout = 'flex',
16
+ icon,
17
+ flow = 's',
18
+ ...props
19
+ }: AlertProps) {
20
+ const presetData = type ? PRESETS[type] : null;
21
+ const _icon = icon || presetData?.icon || 'info';
22
+ const _color = keycolor || presetData?.color || 'currentColor';
23
+
24
+ return {
25
+ icon: _icon,
26
+ layout,
27
+ flow,
28
+ lismClass: 'c--alert u-cbox',
29
+ keycolor: _color,
30
+ ai: 'center',
31
+ p: '15',
32
+ g: '15',
33
+ bd: true,
34
+ bdrs: '10',
35
+ ...props,
36
+ };
37
+ }
@@ -0,0 +1,33 @@
1
+ type PresetData = {
2
+ icon: string;
3
+ color: string;
4
+ };
5
+
6
+ const PRESETS: Record<string, PresetData> = {
7
+ alert: {
8
+ icon: 'alert',
9
+ color: 'red',
10
+ },
11
+ point: {
12
+ icon: 'lightbulb',
13
+ color: 'orange',
14
+ },
15
+ warning: {
16
+ icon: 'warning',
17
+ color: 'yellow',
18
+ },
19
+ check: {
20
+ icon: 'check-circle',
21
+ color: 'green',
22
+ },
23
+ help: {
24
+ icon: 'question',
25
+ color: 'purple',
26
+ },
27
+ info: {
28
+ icon: 'info',
29
+ color: 'blue',
30
+ },
31
+ };
32
+
33
+ export default PRESETS;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import { Flow, Lism, Center, Icon } from 'lism-css/react';
3
+ import getAlertProps, { type AlertProps } from '../getProps';
4
+
5
+ export default function Alert({ children, ...inputProps }: AlertProps & { children?: ReactNode }) {
6
+ const { icon, layout, flow, ...alertProps } = getAlertProps(inputProps);
7
+
8
+ return (
9
+ <Lism layout={layout} {...alertProps}>
10
+ <Center isSide={layout === 'sideMain'} c='keycolor' fz='xl' fxsh='0'>
11
+ <Icon icon={icon} />
12
+ </Center>
13
+ <Flow flow={flow}>{children}</Flow>
14
+ </Lism>
15
+ );
16
+ }
@@ -0,0 +1 @@
1
+ export { default } from './Alert';
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import { Frame } from 'lism-css/astro';
3
- // import '../_style.css';
4
3
 
5
4
  const { size = '1.5em', src = '', alt = '', ...props } = Astro.props;
6
5
  ---
@@ -1,5 +1,4 @@
1
1
  import { Frame } from 'lism-css/react';
2
- // import '../_style.css';
3
2
 
4
3
  export default function Avatar({ size = '1.5em', src = '', alt = '', ...props }) {
5
4
  return (
@@ -0,0 +1 @@
1
+ /* Callout component styles */
@@ -0,0 +1,24 @@
1
+ ---
2
+ import { Flow, Flex, Stack, Icon, Center } from 'lism-css/astro';
3
+ import getCalloutProps, { type CalloutProps } from '../getProps';
4
+
5
+ type Props = CalloutProps;
6
+
7
+ const { icon, title, flow, ...calloutProps } = getCalloutProps(Astro.props);
8
+ ---
9
+
10
+ <Stack {...calloutProps}>
11
+ {
12
+ title && (
13
+ <Flex class='c--callout_head' c='keycolor' fw='bold' ai='center' g='10'>
14
+ <Center class='c--callout_icon' fz='xl'>
15
+ <Icon icon={icon} />
16
+ </Center>
17
+ <span class='c--callout_title'>{title}</span>
18
+ </Flex>
19
+ )
20
+ }
21
+ <Flow class='c--callout_body' flow={flow}>
22
+ <slot />
23
+ </Flow>
24
+ </Stack>