Skip to content

Commit

Permalink
fix: minor fix and missing plugins (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: Sacha Stafyniak <sacha@digisquad.io>
  • Loading branch information
bpsmartdesign and stafyniaksacha committed Aug 7, 2023
1 parent 5ee642b commit 982de65
Show file tree
Hide file tree
Showing 20 changed files with 739 additions and 71 deletions.
8 changes: 8 additions & 0 deletions src/plugins/components/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const defaultAccordionConfig = {
detailOpenAndDot: {
bg: 'primary-500',
},
headerInner: {
text: 'muted-800',
textDark: 'white',
},
dot: {
size: '3',
rounded: 'full',
Expand Down Expand Up @@ -84,6 +88,10 @@ export default plugin.withOptions(
},
[`.${prefix}-accordion-header`]: {
[`@apply flex items-center justify-between`]: {},

[`.${prefix}-accordion-header-inner`]: {
[`@apply text-muted-800 dark:text-white`]: {},
},
},
[`.${prefix}-accordion-dot`]: {
[`@apply ms-2 h-${config.dot.size} w-${config.dot.size} rounded-${config.dot.rounded} transition-colors duration-${config.dot.duration}`]:
Expand Down
1 change: 1 addition & 0 deletions src/plugins/components/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export default plugin.withOptions(
addComponents({
[`.${prefix}-autocomplete`]: {
[`@apply w-full relative`]: {},

[`.${prefix}-autocomplete-label, .${prefix}-label-float`]: {
[`@apply ${prefix}-label`]: {},
},
Expand Down
83 changes: 82 additions & 1 deletion src/plugins/components/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const defaultAvatarConfig = {
size: '1.5',
},
text: 'xs',
straightPosition: '0',
roundedOrInnerDotPosition: '0',
curvedOrInner: {
rounded: 'md',
Expand All @@ -79,6 +80,7 @@ const defaultAvatarConfig = {
size: '2',
},
text: 'sm',
straightPosition: '0',
roundedOrInnerDotPosition: '0',
curvedOrInner: {
rounded: 'lg',
Expand All @@ -96,6 +98,7 @@ const defaultAvatarConfig = {
size: '2',
},
text: 'sm',
straightPosition: '0',
roundedOrInner: {
rounded: 'md',
dotPosition: '0',
Expand All @@ -116,6 +119,7 @@ const defaultAvatarConfig = {
size: '3',
},
text: 'sm',
straightPosition: '0',
roundedOrInner: {
rounded: 'lg',
dotPosition: '0',
Expand All @@ -136,6 +140,7 @@ const defaultAvatarConfig = {
size: '3',
},
text: 'sm',
straightPosition: '0',
roundedOrInner: {
rounded: 'lg',
dotPosition: '0',
Expand All @@ -156,6 +161,7 @@ const defaultAvatarConfig = {
size: '4',
},
text: 'base',
straightPosition: '0',
roundedOrInner: {
rounded: 'xl',
dotPosition: '0',
Expand All @@ -176,6 +182,7 @@ const defaultAvatarConfig = {
size: '4',
},
text: 'xl',
straightPosition: '0',
roundedOrInner: {
rounded: 'xl',
dotPosition: '0',
Expand All @@ -196,6 +203,7 @@ const defaultAvatarConfig = {
size: '4',
},
text: '2xl',
straightPosition: '0',
roundedOrInner: {
rounded: 'xl',
dotPosition: '0',
Expand All @@ -216,6 +224,7 @@ const defaultAvatarConfig = {
size: '4',
},
text: '3xl',
straightPosition: '0',
roundedOrInner: {
rounded: 'xl',
dotPosition: '0',
Expand Down Expand Up @@ -261,7 +270,7 @@ export default plugin.withOptions(
},
},
[`.${prefix}-avatar-img`]: {
[`@apply max-h-${config.avatarImg.maxSize} max-w-${config.avatarImg.maxSize} object-cover shadow-${config.avatarImg.shadow} dark:border-${config.avatarImg.borderDark}`]:
[`@apply h-${config.avatarImg.maxSize} max-h-${config.avatarImg.maxSize} w-${config.avatarImg.maxSize} max-w-${config.avatarImg.maxSize} object-cover shadow-${config.avatarImg.shadow} dark:border-${config.avatarImg.borderDark}`]:
{},
},
[`.${prefix}-avatar-text`]: {
Expand Down Expand Up @@ -341,6 +350,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarXXS.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarXXS.straightPosition} top-${config.avatarXXS.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded`]: {},

Expand Down Expand Up @@ -378,6 +395,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarXS.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarXS.straightPosition} top-${config.avatarXS.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded`]: {},

Expand Down Expand Up @@ -415,6 +440,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarSM.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarSM.straightPosition} top-${config.avatarSM.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatarSM.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -452,6 +485,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarMD.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarMD.straightPosition} top-${config.avatarMD.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatarMD.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -489,6 +530,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarLG.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarLG.straightPosition} top-${config.avatarLG.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatarLG.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -526,6 +575,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatarXL.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatarXL.straightPosition} top-${config.avatarXL.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatarXL.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -564,6 +621,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatar2XL.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatar2XL.straightPosition} top-${config.avatar2XL.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatar2XL.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -602,6 +667,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatar3XL.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatar3XL.straightPosition} top-${config.avatar3XL.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatar3XL.roundedOrInner.rounded}`]: {},

Expand Down Expand Up @@ -640,6 +713,14 @@ export default plugin.withOptions(
[`.${prefix}-avatar-text`]: {
[`@apply text-${config.avatar4XL.text}`]: {},
},
[`&.${prefix}-avatar-straight, .${prefix}-avatar-inner`]: {
[`@apply rounded-none`]: {},

[`.${prefix}-avatar-dot`]: {
[`@apply end-${config.avatar4XL.straightPosition} top-${config.avatar4XL.straightPosition}`]:
{},
},
},
[`&.${prefix}-avatar-rounded, .${prefix}-avatar-inner`]: {
[`@apply rounded-${config.avatar4XL.roundedOrInner.rounded}`]: {},

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/components/button-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export default plugin.withOptions(

return function ({ addComponents, theme }) {
const config = theme(
'shurikenUi.buttonClose'
'shurikenUi.buttonIcon'
) satisfies typeof defaultButtonIconConfig

addComponents({
[`.${prefix}-button-close`]: {
[`.${prefix}-button-icon`]: {
[`@apply ${prefix}-focus relative inline-flex items-center justify-center space-x-1 font-sans text-${config.text} font-${config.font} leading-5 no-underline outline-none transition-all duration-${config.duration} disabled:opacity-60 disabled:cursor-not-allowed hover:shadow-none`]:
{},

Expand Down Expand Up @@ -142,7 +142,7 @@ export default plugin.withOptions(
return {
theme: {
shurikenUi: {
buttonClose: defaultButtonIconConfig,
buttonIcon: defaultButtonIconConfig,
},
},
}
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ export default plugin.withOptions(
[`@apply bg-${config.badge.primary}`]: {},
},
},

[`&.${prefix}-badge-info`]: {
[`.${prefix}-button-badge-pulse`]: {
[`@apply bg-${config.badge.info}`]: {},
Expand All @@ -480,7 +479,6 @@ export default plugin.withOptions(
[`@apply bg-${config.badge.info}`]: {},
},
},

[`&.${prefix}-badge-success`]: {
[`.${prefix}-button-badge-pulse`]: {
[`@apply bg-${config.badge.success}`]: {},
Expand All @@ -490,7 +488,6 @@ export default plugin.withOptions(
[`@apply bg-${config.badge.success}`]: {},
},
},

[`&.${prefix}-badge-warning`]: {
[`.${prefix}-button-badge-pulse`]: {
[`@apply bg-${config.badge.warning}`]: {},
Expand All @@ -500,7 +497,6 @@ export default plugin.withOptions(
[`@apply bg-${config.badge.warning}`]: {},
},
},

[`&.${prefix}-badge-danger`]: {
[`.${prefix}-button-badge-pulse`]: {
[`@apply bg-${config.badge.danger}`]: {},
Expand Down
Loading

0 comments on commit 982de65

Please sign in to comment.