Skip to content

Commit

Permalink
fix: styles of as prop in Skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaakher committed Aug 15, 2024
1 parent 9f0ad8b commit 804e6c6
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 10 deletions.
7 changes: 7 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hawa-docs

## 0.0.112

### Patch Changes

- Updated dependencies
- @sikka/hawa@0.46.4

## 0.0.111

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawa-docs",
"version": "0.0.111",
"version": "0.0.112",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
Expand Down
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sikka/hawa

## 0.46.4

### Patch Changes

- Fix styles for `as` prop in `Skeleton`
- Remove test console logs from `Input`

## 0.46.3

### Patch Changes
Expand Down
5 changes: 1 addition & 4 deletions packages/components/elements/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,11 @@ export const Input = forwardRef<HTMLInputElement, InputFieldProps>(

if (props.onChange) {
if (props.type === "number" && props.maxLength) {
console.log("type is ", props.type);
console.log("max length is ", props.maxLength);
let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
const newEvent = { ...e, target: { ...e.target, value: v } };
setValue(v);
props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);
} else {
console.log("NETIHERRRER");
const newEvent = { ...e, target: { ...e.target, value: newValue } };
setValue(newValue);
props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);
Expand Down Expand Up @@ -135,7 +132,7 @@ export const Input = forwardRef<HTMLInputElement, InputFieldProps>(
)}
{props.isLoading ? (
<div className="hawa-pb-2 hawa-w-full">
<Skeleton className="hawa-h-[40px] hawa-w-full" />
<Skeleton as="input" />
</div>
) : props.isLoadingError ? (
<div className="hawa-pb-2 hawa-w-full">
Expand Down
5 changes: 2 additions & 3 deletions packages/components/elements/skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ function Skeleton({

const styledAs = {
div: "",
input: "!h-[38px] !w-full",
input: "hawa-h-[40px] hawa-w-full",
};

return (
<div
className={cn(
animationStyles[animation],
content &&
"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
fade && fadeStyle[fade],
styledAs[as],
className,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sikka/hawa",
"version": "0.46.3",
"version": "0.46.4",
"description": "Modern UI Kit made with Tailwind",
"author": {
"name": "Sikka Software",
Expand Down
7 changes: 7 additions & 0 deletions packages/storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hawa-storybook

## 0.26.134

### Patch Changes

- Updated dependencies
- @sikka/hawa@0.46.4

## 0.26.133

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawa-storybook",
"version": "0.26.133",
"version": "0.26.134",
"description": "Modern UI Kit made with Tailwind",
"author": {
"name": "Sikka Software",
Expand Down
9 changes: 9 additions & 0 deletions packages/storybook/stories/ElementsStories/Input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import { Lock, Search } from "lucide-react";

import { SA, USA } from "@sikka/alam";
import { Label, Skeleton } from "@sikka/hawa/elements";
import { Button } from "@sikka/hawa/elements/button";
import { DropdownMenuRadio } from "@sikka/hawa/elements/dropdownMenu";
import { Input } from "@sikka/hawa/elements/input";
Expand Down Expand Up @@ -37,6 +38,14 @@ export const Default: Story = {
onChange={(e) => console.log("im outside", e.target.value)}
/>
</div>
<div className="hawa-flex hawa-flex-row hawa-gap-4">
<Input label="Input Field" placeholder={"Bismillah"} />
<Input label="Skeleton" isLoading placeholder={"Bismillah"} />
<div className="hawa-flex hawa-w-full hawa-flex-col hawa-gap-2">
<Label>Loading Skeleton</Label>
<Skeleton as="input" />
</div>
</div>
</div>
);
},
Expand Down

0 comments on commit 804e6c6

Please sign in to comment.