initial release
This commit is contained in:
22
theme/keywind/login/components/atoms/alert.ftl
Normal file
22
theme/keywind/login/components/atoms/alert.ftl
Normal file
@@ -0,0 +1,22 @@
|
||||
<#macro kw color="">
|
||||
<#switch color>
|
||||
<#case "error">
|
||||
<#assign colorClass="bg-red-100 text-red-600">
|
||||
<#break>
|
||||
<#case "info">
|
||||
<#assign colorClass="bg-blue-100 text-blue-600">
|
||||
<#break>
|
||||
<#case "success">
|
||||
<#assign colorClass="bg-green-100 text-green-600">
|
||||
<#break>
|
||||
<#case "warning">
|
||||
<#assign colorClass="bg-orange-100 text-orange-600">
|
||||
<#break>
|
||||
<#default>
|
||||
<#assign colorClass="bg-blue-100 text-blue-600">
|
||||
</#switch>
|
||||
|
||||
<div class="${colorClass} p-4 rounded-lg text-sm" role="alert">
|
||||
<#nested>
|
||||
</div>
|
||||
</#macro>
|
||||
5
theme/keywind/login/components/atoms/body.ftl
Normal file
5
theme/keywind/login/components/atoms/body.ftl
Normal file
@@ -0,0 +1,5 @@
|
||||
<#macro kw>
|
||||
<body class="bg-secondary-100 flex flex-col items-center justify-center min-h-screen sm:py-16">
|
||||
<#nested>
|
||||
</body>
|
||||
</#macro>
|
||||
5
theme/keywind/login/components/atoms/button-group.ftl
Normal file
5
theme/keywind/login/components/atoms/button-group.ftl
Normal file
@@ -0,0 +1,5 @@
|
||||
<#macro kw>
|
||||
<div class="flex flex-col pt-4 space-y-2">
|
||||
<#nested>
|
||||
</div>
|
||||
</#macro>
|
||||
33
theme/keywind/login/components/atoms/button.ftl
Normal file
33
theme/keywind/login/components/atoms/button.ftl
Normal file
@@ -0,0 +1,33 @@
|
||||
<#macro kw color="" component="button" size="" rest...>
|
||||
<#switch color>
|
||||
<#case "primary">
|
||||
<#assign colorClass="bg-primary-600 text-white focus:ring-primary-600 hover:bg-primary-700">
|
||||
<#break>
|
||||
<#case "secondary">
|
||||
<#assign colorClass="bg-secondary-100 text-secondary-600 focus:ring-secondary-600 hover:bg-secondary-200 hover:text-secondary-900">
|
||||
<#break>
|
||||
<#default>
|
||||
<#assign colorClass="bg-primary-600 text-white focus:ring-primary-600 hover:bg-primary-700">
|
||||
</#switch>
|
||||
|
||||
<#switch size>
|
||||
<#case "medium">
|
||||
<#assign sizeClass="px-4 py-2 text-sm">
|
||||
<#break>
|
||||
<#case "small">
|
||||
<#assign sizeClass="px-2 py-1 text-xs">
|
||||
<#break>
|
||||
<#default>
|
||||
<#assign sizeClass="px-4 py-2 text-sm">
|
||||
</#switch>
|
||||
|
||||
<${component}
|
||||
class="${colorClass} ${sizeClass} flex justify-center relative rounded-lg w-full focus:outline-none focus:ring-2 focus:ring-offset-2"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<#nested>
|
||||
</${component}>
|
||||
</#macro>
|
||||
19
theme/keywind/login/components/atoms/card.ftl
Normal file
19
theme/keywind/login/components/atoms/card.ftl
Normal file
@@ -0,0 +1,19 @@
|
||||
<#macro kw content="" footer="" header="">
|
||||
<div class="bg-white p-8 rounded-lg space-y-6">
|
||||
<#if header?has_content>
|
||||
<div class="space-y-4">
|
||||
${header}
|
||||
</div>
|
||||
</#if>
|
||||
<#if content?has_content>
|
||||
<div class="space-y-4">
|
||||
${content}
|
||||
</div>
|
||||
</#if>
|
||||
<#if footer?has_content>
|
||||
<div class="space-y-4">
|
||||
${footer}
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</#macro>
|
||||
19
theme/keywind/login/components/atoms/checkbox.ftl
Normal file
19
theme/keywind/login/components/atoms/checkbox.ftl
Normal file
@@ -0,0 +1,19 @@
|
||||
<#macro kw checked=false label="" name="" rest...>
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
<#if checked>checked</#if>
|
||||
|
||||
class="border-secondary-200 h-4 rounded text-primary-600 w-4 focus:ring-primary-200 focus:ring-opacity-50"
|
||||
id="${name}"
|
||||
name="${name}"
|
||||
type="checkbox"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<label class="ml-2 text-secondary-600 text-sm" for="${name}">
|
||||
${label}
|
||||
</label>
|
||||
</div>
|
||||
</#macro>
|
||||
5
theme/keywind/login/components/atoms/container.ftl
Normal file
5
theme/keywind/login/components/atoms/container.ftl
Normal file
@@ -0,0 +1,5 @@
|
||||
<#macro kw>
|
||||
<div class="max-w-md space-y-6 w-full">
|
||||
<#nested>
|
||||
</div>
|
||||
</#macro>
|
||||
11
theme/keywind/login/components/atoms/form.ftl
Normal file
11
theme/keywind/login/components/atoms/form.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
<#macro kw rest...>
|
||||
<form
|
||||
class="m-0 space-y-4"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<#nested>
|
||||
</form>
|
||||
</#macro>
|
||||
5
theme/keywind/login/components/atoms/heading.ftl
Normal file
5
theme/keywind/login/components/atoms/heading.ftl
Normal file
@@ -0,0 +1,5 @@
|
||||
<#macro kw>
|
||||
<h1 class="text-center text-xl">
|
||||
<#nested>
|
||||
</h1>
|
||||
</#macro>
|
||||
78
theme/keywind/login/components/atoms/input.ftl
Normal file
78
theme/keywind/login/components/atoms/input.ftl
Normal file
@@ -0,0 +1,78 @@
|
||||
<#import "/assets/icons/eye.ftl" as iconEye>
|
||||
<#import "/assets/icons/eye-slash.ftl" as iconEyeSlash>
|
||||
|
||||
<#macro
|
||||
kw
|
||||
autofocus=false
|
||||
class="block border-secondary-200 mt-1 rounded-md w-full focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 sm:text-sm"
|
||||
disabled=false
|
||||
invalid=false
|
||||
label=""
|
||||
message=""
|
||||
name=""
|
||||
required=true
|
||||
type="text"
|
||||
rest...
|
||||
>
|
||||
<div>
|
||||
<label class="sr-only" for="${name}">
|
||||
${label}
|
||||
</label>
|
||||
<#if type == "password">
|
||||
<div class="relative" x-data="{ show: false }">
|
||||
<input
|
||||
<#if autofocus>autofocus</#if>
|
||||
<#if disabled>disabled</#if>
|
||||
<#if required>required</#if>
|
||||
|
||||
aria-invalid="${invalid?c}"
|
||||
class="${class}"
|
||||
id="${name}"
|
||||
name="${name}"
|
||||
placeholder="${label}"
|
||||
:type="show ? 'text' : 'password'"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<button
|
||||
@click="show = !show"
|
||||
aria-controls="${name}"
|
||||
:aria-expanded="show"
|
||||
class="absolute text-secondary-400 right-3 top-3 sm:top-2"
|
||||
type="button"
|
||||
>
|
||||
<div x-show="!show">
|
||||
<@iconEye.kw />
|
||||
</div>
|
||||
<div x-cloak x-show="show">
|
||||
<@iconEyeSlash.kw />
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<#else>
|
||||
<input
|
||||
<#if autofocus>autofocus</#if>
|
||||
<#if disabled>disabled</#if>
|
||||
<#if required>required</#if>
|
||||
|
||||
aria-invalid="${invalid?c}"
|
||||
class="${class}"
|
||||
id="${name}"
|
||||
name="${name}"
|
||||
placeholder="${label}"
|
||||
type="${type}"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
</#if>
|
||||
<#if invalid?? && message??>
|
||||
<div class="mt-2 text-red-600 text-sm">
|
||||
${message?no_esc}
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</#macro>
|
||||
30
theme/keywind/login/components/atoms/link.ftl
Normal file
30
theme/keywind/login/components/atoms/link.ftl
Normal file
@@ -0,0 +1,30 @@
|
||||
<#macro kw color="" component="a" size="" rest...>
|
||||
<#switch color>
|
||||
<#case "primary">
|
||||
<#assign colorClass="text-primary-600 hover:text-primary-500">
|
||||
<#break>
|
||||
<#case "secondary">
|
||||
<#assign colorClass="text-secondary-600 hover:text-secondary-900">
|
||||
<#break>
|
||||
<#default>
|
||||
<#assign colorClass="text-primary-600 hover:text-primary-500">
|
||||
</#switch>
|
||||
|
||||
<#switch size>
|
||||
<#case "small">
|
||||
<#assign sizeClass="text-sm">
|
||||
<#break>
|
||||
<#default>
|
||||
<#assign sizeClass="">
|
||||
</#switch>
|
||||
|
||||
<${component}
|
||||
class="<#compress>${colorClass} ${sizeClass} inline-flex</#compress>"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<#nested>
|
||||
</${component}>
|
||||
</#macro>
|
||||
8
theme/keywind/login/components/atoms/logo.ftl
Normal file
8
theme/keywind/login/components/atoms/logo.ftl
Normal file
@@ -0,0 +1,8 @@
|
||||
<#macro kw>
|
||||
<div class="font-bold text-center text-2xl">
|
||||
<#--<#nested>-->
|
||||
<div class="logo-container">
|
||||
<a href="${client.baseUrl}"><img src="${url.resourcesPath}/header-logo.png" alt="Company Logo"></a>
|
||||
</div>
|
||||
</div>
|
||||
</#macro>
|
||||
5
theme/keywind/login/components/atoms/nav.ftl
Normal file
5
theme/keywind/login/components/atoms/nav.ftl
Normal file
@@ -0,0 +1,5 @@
|
||||
<#macro kw>
|
||||
<div class="flex justify-around">
|
||||
<#nested>
|
||||
</div>
|
||||
</#macro>
|
||||
18
theme/keywind/login/components/atoms/radio.ftl
Normal file
18
theme/keywind/login/components/atoms/radio.ftl
Normal file
@@ -0,0 +1,18 @@
|
||||
<#macro kw checked=false id="" label="" rest...>
|
||||
<div>
|
||||
<input
|
||||
<#if checked>checked</#if>
|
||||
|
||||
class="border-secondary-200 focus:ring-primary-600"
|
||||
id="${id}"
|
||||
type="radio"
|
||||
|
||||
<#list rest as attrName, attrValue>
|
||||
${attrName}="${attrValue}"
|
||||
</#list>
|
||||
>
|
||||
<label class="ml-2 text-secondary-600 text-sm" for="${id}">
|
||||
${label}
|
||||
</label>
|
||||
</div>
|
||||
</#macro>
|
||||
Reference in New Issue
Block a user