@ims360/svelte-ivory 0.2.2 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  export { default as Drawer } from './drawer/Drawer.svelte';
2
2
  export { default as Heading } from './Heading.svelte';
3
3
  export { default as HiddenBackground } from './hiddenBackground/HiddenBackground.svelte';
4
- export { default as Modal, type ModalProps, type ModalVariant } from './modal/Modal.svelte';
4
+ export { default as Modal, type ModalProps } from './modal/Modal.svelte';
5
5
  export { default as Popover, type PopoverPlacement, type PopoverProps } from './popover/Popover.svelte';
6
6
  export { getTabContext, Tab, TabPanel, Tabs, type TabPanelProps, type TabProps, type TabsProps } from './tabs';
7
7
  export { default as Tooltip, type TooltipProps } from './tooltip/Tooltip.svelte';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EACH,OAAO,IAAI,OAAO,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,aAAa,EACb,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,SAAS,EACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACH,OAAO,IAAI,OAAO,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,aAAa,EACb,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,SAAS,EACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" module>
2
+ import type { Variant } from '../../..';
2
3
  import { theme } from '../../../theme.svelte';
3
4
  import type { TransitionProps } from '../../../types';
4
5
  import { merge } from '../../../utils/merge';
@@ -23,12 +24,10 @@
23
24
  * */
24
25
  closeOnOutsideClick?: boolean;
25
26
  /** Variant of the modal, applies styling to the header */
26
- variant?: ModalVariant;
27
+ variant?: Variant;
27
28
  title?: string | Snippet;
28
29
  onclick?: MouseEventHandler<HTMLDivElement>;
29
30
  };
30
-
31
- export type ModalVariant = 'success' | 'warning' | 'error' | 'info';
32
31
  </script>
33
32
 
34
33
  <script lang="ts">
@@ -108,10 +107,13 @@
108
107
  class={[
109
108
  'flex flex-row items-center justify-between gap-4 px-4 py-3',
110
109
  !variant && 'pb-0',
110
+ variant === 'primary' && 'preset-tonal-primary',
111
+ variant === 'secondary' && 'preset-tonal-secondary',
112
+ variant === 'tertiary' && 'preset-tonal-tertiary',
111
113
  variant === 'success' && 'preset-tonal-success',
112
114
  variant === 'warning' && 'preset-tonal-warning',
113
115
  variant === 'error' && 'preset-tonal-error',
114
- variant === 'info' && 'preset-tonal-primary'
116
+ variant === 'surface' && 'preset-tonal-surface'
115
117
  ]}
116
118
  >
117
119
  {#if title}
@@ -1,3 +1,4 @@
1
+ import type { Variant } from '../../..';
1
2
  import type { TransitionProps } from '../../../types';
2
3
  import { type Snippet } from 'svelte';
3
4
  import type { ClassValue, MouseEventHandler } from 'svelte/elements';
@@ -16,11 +17,10 @@ export type ModalProps = TransitionProps & {
16
17
  * */
17
18
  closeOnOutsideClick?: boolean;
18
19
  /** Variant of the modal, applies styling to the header */
19
- variant?: ModalVariant;
20
+ variant?: Variant;
20
21
  title?: string | Snippet;
21
22
  onclick?: MouseEventHandler<HTMLDivElement>;
22
23
  };
23
- export type ModalVariant = 'success' | 'warning' | 'error' | 'info';
24
24
  interface Props extends ModalProps {
25
25
  /** If you don't want the title and close button to be included you can overwrite the default modal */
26
26
  modal?: Snippet;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/modal/Modal.svelte.ts"],"names":[],"mappings":"AAII,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIrE,sFAAsF;AACtF,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG;IACvC,iEAAiE;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;SAIK;IACL,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,OAAO,C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AU,KAAM,SAAQ,UAAU;IAC9B,sGAAsG;IACtG,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAmGL,oFAAoF;AACpF,QAAA,MAAM,KAAK;;;;;MAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { theme, type Theme } from './theme.svelte';
2
2
  export { type IvoryComponent } from './types';
3
+ export type Variant = 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'error' | 'surface';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,OAAO,GACb,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ims360/svelte-ivory",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],
@@ -1,7 +1,7 @@
1
1
  export { default as Drawer } from './drawer/Drawer.svelte';
2
2
  export { default as Heading } from './Heading.svelte';
3
3
  export { default as HiddenBackground } from './hiddenBackground/HiddenBackground.svelte';
4
- export { default as Modal, type ModalProps, type ModalVariant } from './modal/Modal.svelte';
4
+ export { default as Modal, type ModalProps } from './modal/Modal.svelte';
5
5
  export {
6
6
  default as Popover,
7
7
  type PopoverPlacement,
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" module>
2
+ import type { Variant } from '$lib';
2
3
  import { theme } from '$lib/theme.svelte';
3
4
  import type { TransitionProps } from '$lib/types';
4
5
  import { merge } from '$lib/utils/merge';
@@ -23,12 +24,10 @@
23
24
  * */
24
25
  closeOnOutsideClick?: boolean;
25
26
  /** Variant of the modal, applies styling to the header */
26
- variant?: ModalVariant;
27
+ variant?: Variant;
27
28
  title?: string | Snippet;
28
29
  onclick?: MouseEventHandler<HTMLDivElement>;
29
30
  };
30
-
31
- export type ModalVariant = 'success' | 'warning' | 'error' | 'info';
32
31
  </script>
33
32
 
34
33
  <script lang="ts">
@@ -108,10 +107,13 @@
108
107
  class={[
109
108
  'flex flex-row items-center justify-between gap-4 px-4 py-3',
110
109
  !variant && 'pb-0',
110
+ variant === 'primary' && 'preset-tonal-primary',
111
+ variant === 'secondary' && 'preset-tonal-secondary',
112
+ variant === 'tertiary' && 'preset-tonal-tertiary',
111
113
  variant === 'success' && 'preset-tonal-success',
112
114
  variant === 'warning' && 'preset-tonal-warning',
113
115
  variant === 'error' && 'preset-tonal-error',
114
- variant === 'info' && 'preset-tonal-primary'
116
+ variant === 'surface' && 'preset-tonal-surface'
115
117
  ]}
116
118
  >
117
119
  {#if title}
package/src/lib/index.ts CHANGED
@@ -1,3 +1,12 @@
1
1
  // Reexport your entry components here
2
2
  export { theme, type Theme } from './theme.svelte';
3
3
  export { type IvoryComponent } from './types';
4
+
5
+ export type Variant =
6
+ | 'primary'
7
+ | 'secondary'
8
+ | 'tertiary'
9
+ | 'success'
10
+ | 'warning'
11
+ | 'error'
12
+ | 'surface';