@juspay/svelte-ui-components 1.4.0 → 1.5.0
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/dist/Badge/Badge.svelte +2 -1
- package/dist/CheckListItem/CheckListItem.svelte +12 -4
- package/dist/CheckListItem/CheckListItem.svelte.d.ts +3 -1
- package/dist/Stepper/Step.svelte +73 -0
- package/dist/Stepper/Step.svelte.d.ts +21 -0
- package/dist/Stepper/Stepper.svelte +55 -0
- package/dist/Stepper/Stepper.svelte.d.ts +19 -0
- package/dist/Stepper/properties.d.ts +8 -0
- package/dist/Stepper/properties.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/Badge/Badge.svelte
CHANGED
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
border-radius: var(--badge-img-border-radius, 6px);
|
|
40
40
|
width: var(--badge-img-width, 64px);
|
|
41
41
|
height: var(--badge-img-height, 64px);
|
|
42
|
-
object-fit: contain;
|
|
42
|
+
object-fit: var(--badge-object-fit, contain);
|
|
43
43
|
box-shadow: var(--badge-img-icon-shadow, 0 0 0 0.5px #798fa54d);
|
|
44
|
+
background-color: var(--badge-img-background-color);
|
|
44
45
|
}
|
|
45
46
|
</style>
|
|
@@ -12,10 +12,14 @@ function handleCheckboxClick(e) {
|
|
|
12
12
|
|
|
13
13
|
<div class="container">
|
|
14
14
|
<input type="checkbox" class="checkbox" bind:checked on:click={handleCheckboxClick} />
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
{#if $$slots.checkboxLabel}
|
|
16
|
+
<slot name="checkboxLabel" />
|
|
17
|
+
{:else}
|
|
18
|
+
<span class="text">
|
|
19
|
+
<!-- eslint-disable-next-line -->
|
|
20
|
+
{@html text}
|
|
21
|
+
</span>
|
|
22
|
+
{/if}
|
|
19
23
|
</div>
|
|
20
24
|
|
|
21
25
|
<style>
|
|
@@ -36,5 +40,9 @@ function handleCheckboxClick(e) {
|
|
|
36
40
|
border: 5px solid red;
|
|
37
41
|
height: var(--checkbox-height, 24px);
|
|
38
42
|
width: var(--checkbox-width, 24px);
|
|
43
|
+
margin: var(--checkbox-margin);
|
|
44
|
+
padding: var(--checkbox-padding);
|
|
45
|
+
border-radius: var(--checkbox-border-radius);
|
|
46
|
+
visibility: var(--checkbox-visibility);
|
|
39
47
|
}
|
|
40
48
|
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
export let stepIndex;
|
|
3
|
+
export let label;
|
|
4
|
+
export let icon;
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
function handleStepClick() {
|
|
7
|
+
dispatch("handleStepClick", { selectedIndex: stepIndex });
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="step" on:click={handleStepClick} role="button" tabindex="0" on:keydown>
|
|
12
|
+
{#if icon !== null}
|
|
13
|
+
<div class="step-icon-container">
|
|
14
|
+
<img class="step-icon" src={icon} alt="" />
|
|
15
|
+
</div>
|
|
16
|
+
{:else}
|
|
17
|
+
<div class="step-index-container">
|
|
18
|
+
<div class={'step-index-text'}>
|
|
19
|
+
{stepIndex}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
{/if}
|
|
23
|
+
<div class={'step-text'}>
|
|
24
|
+
{label}
|
|
25
|
+
</div>
|
|
26
|
+
<div class={'separator'} />
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<style>
|
|
30
|
+
.step {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: var(--step-flex-direction, row);
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.step-index-container {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
height: var(--step-index-container-height, 30px);
|
|
41
|
+
width: var(--step-index-container-width, 30px);
|
|
42
|
+
border-radius: var(--step-index-container-radius, 50%);
|
|
43
|
+
background-color: var(--step-index-container-background-color, #798fa5cc);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.separator {
|
|
47
|
+
display: var(--separator-display, block);
|
|
48
|
+
height: var(--separator-height, 1px);
|
|
49
|
+
width: var(--separator-width, 50px);
|
|
50
|
+
margin: var(--separator-margin, 0px 12px 0px 12px);
|
|
51
|
+
background-image: var(
|
|
52
|
+
--separator-background-image,
|
|
53
|
+
repeating-linear-gradient(
|
|
54
|
+
to right,
|
|
55
|
+
var(--separator-background-image-color, #798fa5cc),
|
|
56
|
+
var(--separator-background-image-color, #798fa5cc) 6px,
|
|
57
|
+
transparent 6px,
|
|
58
|
+
transparent 10px
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.step-text {
|
|
64
|
+
margin: var(--step-text-margin, 0px 0px 0px 12px);
|
|
65
|
+
font-size: var(--step-text-font-size, 12px);
|
|
66
|
+
color: var(--step-text-color, #798fa5cc);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.step-index-text {
|
|
70
|
+
font-size: var(--step-index-font-size, 14px);
|
|
71
|
+
color: var(--step-index-color, white);
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
stepIndex: number;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string | null;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
keydown: KeyboardEvent;
|
|
10
|
+
handleStepClick: CustomEvent<any>;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type StepProps = typeof __propDef.props;
|
|
17
|
+
export type StepEvents = typeof __propDef.events;
|
|
18
|
+
export type StepSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Step extends SvelteComponent<StepProps, StepEvents, StepSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script>import Step from "./Step.svelte";
|
|
2
|
+
export let properties;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="container">
|
|
6
|
+
{#each properties.steps as currentStep, stepIndex}
|
|
7
|
+
<div
|
|
8
|
+
class:active-step={properties.currentStepIndex === stepIndex}
|
|
9
|
+
class:completed-step={properties.currentStepIndex > stepIndex}
|
|
10
|
+
class="step-container"
|
|
11
|
+
>
|
|
12
|
+
<Step
|
|
13
|
+
on:handleStepClick
|
|
14
|
+
label={currentStep.label}
|
|
15
|
+
icon={currentStep.icon ?? null}
|
|
16
|
+
stepIndex={stepIndex + 1}
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
{/each}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
.container {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: var(--container-flex-direction, row);
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.step-container:last-child {
|
|
30
|
+
--separator-display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.step-container {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.active-step {
|
|
39
|
+
--step-text-color: var(--step-text-active-color, #2f3841);
|
|
40
|
+
--separator-background-image-color: var(--separator-background-image-active-color, #2f3841);
|
|
41
|
+
--step-index-container-background-color: var(
|
|
42
|
+
--step-index-container-active-background-color,
|
|
43
|
+
#2f3841
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.completed-step {
|
|
48
|
+
--step-text-color: var(--step-text-completed-color, #24aa5a);
|
|
49
|
+
--separator-background-image-color: var(--separator-background-image-completed-color, #24aa5a);
|
|
50
|
+
--step-index-container-background-color: var(
|
|
51
|
+
--step-index-container-completed-background-color,
|
|
52
|
+
#24aa5a
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { StepperProperties } from './properties';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
properties: StepperProperties;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
handleStepClick: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type StepperProps = typeof __propDef.props;
|
|
15
|
+
export type StepperEvents = typeof __propDef.events;
|
|
16
|
+
export type StepperSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Stepper extends SvelteComponent<StepperProps, StepperEvents, StepperSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export { default as Toggle } from './Toggle/Toggle.svelte';
|
|
|
18
18
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
19
19
|
export { default as CheckListItem } from './CheckListItem/CheckListItem.svelte';
|
|
20
20
|
export { default as Table } from './Table/Table.svelte';
|
|
21
|
+
export { default as Stepper } from './Stepper/Stepper.svelte';
|
|
22
|
+
export { default as Step } from './Stepper/Step.svelte';
|
|
21
23
|
export type { ButtonProperties } from './Button/properties';
|
|
22
24
|
export type { ModalProperties, ModalAlign, ModalSize } from './Modal/properties';
|
|
23
25
|
export type { InputProperties } from './Input/properties';
|
|
@@ -36,6 +38,7 @@ export type { CarouselProperties } from './Carousel/properties';
|
|
|
36
38
|
export type { BadgeProperties } from './Badge/properties';
|
|
37
39
|
export type { BannerProperties } from './Banner/properties';
|
|
38
40
|
export type { TableProperties } from './Table/properties';
|
|
41
|
+
export type { StepperProperties } from './Stepper/properties';
|
|
39
42
|
export { defaultIconProperties } from './Icon/properties';
|
|
40
43
|
export { defaultButtonProperties } from './Button/properties';
|
|
41
44
|
export { defaultModalProperties } from './Modal/properties';
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,8 @@ export { default as Toggle } from './Toggle/Toggle.svelte';
|
|
|
18
18
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
19
19
|
export { default as CheckListItem } from './CheckListItem/CheckListItem.svelte';
|
|
20
20
|
export { default as Table } from './Table/Table.svelte';
|
|
21
|
+
export { default as Stepper } from './Stepper/Stepper.svelte';
|
|
22
|
+
export { default as Step } from './Stepper/Step.svelte';
|
|
21
23
|
export { defaultIconProperties } from './Icon/properties';
|
|
22
24
|
export { defaultButtonProperties } from './Button/properties';
|
|
23
25
|
export { defaultModalProperties } from './Modal/properties';
|