flowbite-svelte 0.22.13 → 0.22.14

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.22.14](https://github.com/themesberg/flowbite-svelte/compare/v0.22.13...v0.22.14) (2022-07-25)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * $$restProps before $$props.class ([9378cf5](https://github.com/themesberg/flowbite-svelte/commit/9378cf5349446ec8355317e98e462e379350a697))
11
+ * add padding to w-full ([e1008c9](https://github.com/themesberg/flowbite-svelte/commit/e1008c9620f18b42664059595ae3fe1e421e097b))
12
+ * layout and Toc padding ([6a67345](https://github.com/themesberg/flowbite-svelte/commit/6a6734545429c7228a1bf3cbc58f7e4739dbfe65))
13
+ * various minor fixes ([9ac3296](https://github.com/themesberg/flowbite-svelte/commit/9ac3296635db9e7af2a45cc928477ac15e831dc4))
14
+
5
15
  ### [0.22.13](https://github.com/themesberg/flowbite-svelte/compare/v0.22.12...v0.22.13) (2022-07-24)
6
16
 
7
17
  ### [0.22.12](https://github.com/themesberg/flowbite-svelte/compare/v0.22.11...v0.22.12) (2022-07-24)
@@ -1,7 +1,7 @@
1
1
  <script>import classNames from 'classnames';
2
2
  export let color = 'blue';
3
3
  export let large = false;
4
- export let href;
4
+ export let href = undefined;
5
5
  export let rounded = false;
6
6
  let badgeClass;
7
7
  const colors = {
@@ -5,7 +5,7 @@ declare const __propDef: {
5
5
  [x: string]: any;
6
6
  color?: Colors;
7
7
  large?: boolean;
8
- href: string;
8
+ href?: string;
9
9
  rounded?: boolean;
10
10
  };
11
11
  events: {
@@ -1,15 +1,18 @@
1
1
  <script>import classNames from 'classnames';
2
+ import { getContext } from 'svelte';
2
3
  export let type = 'text';
3
4
  export let value = '';
4
5
  export let size = 'md';
5
6
  export let inputClass = 'block w-full border disabled:cursor-not-allowed disabled:opacity-50 rounded-lg';
6
7
  export let color = 'base';
7
8
  const colorClasses = {
8
- base: 'bg-gray-50 border-gray-300 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500',
9
+ base: 'bg-gray-50 border-gray-300 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500',
9
10
  green: 'border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500',
10
11
  red: 'border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500'
11
12
  };
12
13
  export let ref = null;
14
+ // tinted if put in component having its own background
15
+ let background = getContext('background');
13
16
  // you need to this to avoid 2-way binding
14
17
  function setType(node) {
15
18
  node.type = type;
@@ -25,6 +28,10 @@ function setType(node) {
25
28
  class={classNames(
26
29
  inputClass,
27
30
  colorClasses[color],
31
+ color === 'base' &&
32
+ (background
33
+ ? 'dark:bg-gray-600 dark:border-gray-500'
34
+ : 'dark:bg-gray-700 dark:border-gray-600'),
28
35
  {
29
36
  'p-2 sm:text-xs': size === 'sm',
30
37
  'p-2.5 text-sm': size === 'md',
@@ -23,18 +23,10 @@ const sizes = {
23
23
  large: 'w-14 h-7 after:top-0.5 after:left-[4px] after:h-6 after:w-6'
24
24
  };
25
25
  let divClass;
26
- $: divClass = classNames(common, background ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600', colors[$$restProps.color ?? 'blue'], sizes[size]);
26
+ $: divClass = classNames(common, background ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600', colors[$$restProps.color ?? 'blue'], sizes[size], 'relative');
27
27
  </script>
28
28
 
29
- <Checkbox
30
- custom
31
- class="relative {$$props.class}"
32
- {value}
33
- bind:checked
34
- bind:group
35
- {...$$restProps}
36
- on:click
37
- >
29
+ <Checkbox custom {...$$restProps} class={$$props.class} {value} bind:checked bind:group on:click>
38
30
  <div class={divClass} />
39
31
  <slot />
40
32
  </Checkbox>
@@ -6,7 +6,7 @@ export let active = false;
6
6
  setContext('background', true);
7
7
  $: setContext('active', active);
8
8
  let groupClass;
9
- $: groupClass = classNames('rounded-lg border border-gray-200 dark:border-gray-600', 'divide-y divide-gray-200 dark:divide-gray-600', $$props.class);
9
+ $: groupClass = classNames('text-gray-900 bg-white dark:text-gray-200 dark:bg-gray-700', 'rounded-lg border border-gray-200 dark:border-gray-600', 'divide-y divide-gray-200 dark:divide-gray-600', $$props.class);
10
10
  </script>
11
11
 
12
12
  <svelte:element this={active ? 'div' : 'ul'} class={groupClass}>
@@ -8,7 +8,7 @@ export let href = '';
8
8
  let dispatch = createEventDispatcher();
9
9
  const states = {
10
10
  current: 'text-white bg-blue-700 dark:text-white dark:bg-gray-800',
11
- normal: 'text-gray-900 bg-white dark:text-gray-200 dark:bg-gray-700',
11
+ normal: '',
12
12
  disabled: 'text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400'
13
13
  };
14
14
  let focusClass = 'focus:z-40 focus:outline-none focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:focus:ring-gray-500 dark:focus:text-white';
@@ -12,18 +12,9 @@ function init(node) {
12
12
  node.parentElement.classList.add('inset-x-0');
13
13
  }
14
14
  }
15
- let wrapper;
16
- afterUpdate(() => {
17
- if (wrapper) {
18
- const width = wrapper.getBoundingClientRect();
19
- // wrapper.style.marginLeft = '-50%';
20
- // console.log('after', width);
21
- // console.log(wrapper.clientWidth);
22
- }
23
- });
24
15
  </script>
25
16
 
26
- <div class={wrapperClass} use:init bind:this={wrapper}>
17
+ <div class={wrapperClass} use:init>
27
18
  <div class="flex flex-col md:flex-row p-4 max-w-screen-xl justify-center mx-auto">
28
19
  <ul class={ulClass}>
29
20
  {#each items as item, index}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.22.13",
3
+ "version": "0.22.14",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -233,6 +233,7 @@
233
233
  "./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
234
234
  "./types": "./types.js",
235
235
  "./utils/CloseButton.svelte": "./utils/CloseButton.svelte",
236
+ "./utils/OptsButton.svelte": "./utils/OptsButton.svelte",
236
237
  "./utils/clickOutside": "./utils/clickOutside.js",
237
238
  "./utils/generateId": "./utils/generateId.js"
238
239
  },
@@ -12,14 +12,14 @@ const colors = {
12
12
  default: 'focus:ring-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700'
13
13
  };
14
14
  let buttonClass = '';
15
- $: buttonClass = classNames('ml-auto -mx-1 -my-1.5 rounded-lg focus:ring-2 p-1.5 h-8 w-8 focus:outline-none', colors[color], $$props.class);
15
+ $: buttonClass = classNames('ml-auto -mx-1 -my-1.5 rounded-lg focus:ring-2 p-1.5 focus:outline-none', colors[color], $$props.class);
16
16
  </script>
17
17
 
18
18
  <button on:click type="button" class={buttonClass} aria-label="Close">
19
19
  <slot>
20
20
  <span class="sr-only">Close</span>
21
- <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
22
- ><path
21
+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
22
+ <path
23
23
  fill-rule="evenodd"
24
24
  d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
25
25
  clip-rule="evenodd"
@@ -0,0 +1,18 @@
1
+ <script>
2
+ import CloseButton from './CloseButton.svelte';
3
+ </script>
4
+
5
+ <CloseButton on:click {...$$props}>
6
+ <span class="sr-only">Open options</span>
7
+ <svg
8
+ class="w-6 h-6"
9
+ aria-hidden="true"
10
+ fill="currentColor"
11
+ viewBox="0 0 20 20"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ >
14
+ <path
15
+ d="M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"
16
+ />
17
+ </svg>
18
+ </CloseButton>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} OptsButtonProps */
2
+ /** @typedef {typeof __propDef.events} OptsButtonEvents */
3
+ /** @typedef {typeof __propDef.slots} OptsButtonSlots */
4
+ export default class OptsButton extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ }, {
7
+ click: MouseEvent;
8
+ } & {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type OptsButtonProps = typeof __propDef.props;
13
+ export type OptsButtonEvents = typeof __propDef.events;
14
+ export type OptsButtonSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ [x: string]: any;
19
+ };
20
+ events: {
21
+ click: MouseEvent;
22
+ } & {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};