@latte-macchiat-io/latte-vanilla-components 0.0.455 → 0.0.457

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latte-macchiat-io/latte-vanilla-components",
3
- "version": "0.0.455",
3
+ "version": "0.0.457",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,26 +1,25 @@
1
- import { alertBox, alertBoxContent } from './styles.css';
1
+ import { alertBoxContent, AlertBoxVariants } from './styles.css';
2
2
 
3
- import { AlertVariant } from './types';
4
3
  import { Box } from '..';
5
4
 
6
5
  import { themeContract } from '../../../theme/contract.css';
7
- import { cn } from '../../../utils/styleOverride';
6
+
8
7
  import { Heading } from '../../Heading';
9
8
  import { Icon } from '../../Icon';
10
9
  import icons from '../../Icon/path';
11
10
  import { Paragraph } from '../../Paragraph';
12
11
 
13
- export type AlertBoxProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {
14
- title?: string | null;
15
- text: string;
16
- noIcon?: boolean;
17
- variant?: AlertVariant;
18
- };
12
+ export type AlertBoxProps = React.HTMLAttributes<HTMLDivElement> &
13
+ AlertBoxVariants & {
14
+ text: string;
15
+ noIcon?: boolean;
16
+ title?: string | null;
17
+ };
19
18
 
20
19
  export const AlertBox = ({ title, text, noIcon = false, variant = 'info', className }: AlertBoxProps) => {
21
20
  return (
22
- <Box className={cn(alertBox({ variant }), className)} variant={variant}>
23
- {!noIcon && <Icon iconPath={icons.close} size={50} color={themeContract.boxAlert.variant[variant].iconColor} />}
21
+ <Box className={className} variant={variant}>
22
+ {/* {!noIcon && <Icon iconPath={icons.close} size={50} color={themeContract.boxAlert.variant[variant].iconColor} />} */}
24
23
  <div className={alertBoxContent}>
25
24
  {title && <Heading as="h4">{title}</Heading>}
26
25
  <Paragraph>{text}</Paragraph>
@@ -0,0 +1,30 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+
4
+ import { AlertBox } from '.';
5
+
6
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
+ const meta: Meta<typeof AlertBox> = {
8
+ title: 'Latte Components / 1. Global / AlertBox',
9
+ component: AlertBox,
10
+ parameters: {
11
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
+ layout: 'centered',
13
+ },
14
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
+ tags: ['autodocs'],
16
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
17
+ argTypes: {},
18
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
19
+ };
20
+
21
+ export default meta;
22
+ type Story = StoryObj<typeof meta>;
23
+
24
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
25
+ export const Default: Story = {
26
+ args: {
27
+ title: 'Lorem ipsum',
28
+ text: 'Lorem ipsum Lorem ipsum',
29
+ },
30
+ };
@@ -54,16 +54,16 @@ export const box = recipe({
54
54
  backgroundColor: themeContract.section.variant.transparent.backgroundColor,
55
55
  },
56
56
  warning: {
57
- backgroundColor: themeContract.section.variant.primary.backgroundColor,
57
+ backgroundColor: themeContract.boxAlert.variant.warning.backgroundColor,
58
58
  },
59
59
  info: {
60
- backgroundColor: themeContract.section.variant.primary.backgroundColor,
60
+ backgroundColor: themeContract.boxAlert.variant.info.backgroundColor,
61
61
  },
62
62
  success: {
63
- backgroundColor: themeContract.section.variant.primary.backgroundColor,
63
+ backgroundColor: themeContract.boxAlert.variant.success.backgroundColor,
64
64
  },
65
65
  danger: {
66
- backgroundColor: themeContract.section.variant.primary.backgroundColor,
66
+ backgroundColor: themeContract.boxAlert.variant.danger.backgroundColor,
67
67
  },
68
68
  },
69
69